if acitve sheet, last sheet is

smiler44

Registered User.
Local time
Today, 14:47
Joined
Jul 15, 2008
Messages
690
I want to know if I am active on the last worksheet. How? I do not know what the last worksheet name will be.

code needs to be something along the lines of
if this is the last worksheet then


I'd also like the code for
the last sheet name is.... but I do not want to selcet the last sheet to obtain the name



This was given to me, Worksheets(Worksheets.Count).Select
It selects the last sheet.

This tells me what the active sheet name is
MsgBox "current worksheet is " & ActiveSheet.Name


smiler44
 
n = Worksheets.Count

lastname = Worksheets(n).Name

I'm sure that you can work with that to achieve what you want.

Brian
 
Brian,
thankyou. Thats got me on my way. I had tried using the brackets but had not got them right. Thanks again

Smiler44
 
HTH and for anybody less experienced than Smiler who might come along I tested this since posting and as expected its fine

Code:
If ActiveSheet.Name = Worksheets(Worksheets.Count).Name Then

Brian
 

Users who are viewing this thread

Back
Top Bottom