VBA - identifying which worksheet is active

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Must be the weather or something but ...
I am having problems working out how to retrieve the sequential number of an
active worksheet (Activeworksheet does not supptort the various properties I
have tried...). Yeah, I know, should be trivial but I am obviosuly not
thinking of the right key words to find any help either. Suggestions much
appreciated. All I want to do really is count how many more worksheets I have
after the active one.
Many thanks and best wishes.
 
The property you are looking for is Index...

NumberOfSheetsRemaining = Worksheets.Count - ActiveSheet.Index

Rick
 
Thanks Rick, very good of you to reply. I had thought of "index" but, when I
tried it in my immediate window, I got a VB error message to say that the
property was not suppoted... Must have mistyped something!
Many thanks again, Boris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top