Sheet number

  • Thread starter Thread starter Glen
  • Start date Start date
G

Glen

I can capture the sheet name with "ActiveSheet.Name"
How do I capture the active sheet number?

Thanks
Glen
 
Norman,
Thanks - this worked great!
Now I need to count the number of sheets selected.
If I use sheets.count I get all sheets.
I only want to count the number selected
Say I have 10 sheets and I only select 3, what would my
command line look like?

MySelectedSheets = ??


Glen
 
MsgBox ActiveWindow.SelectedSheets.Count

If you want to do something on each sheet is easier to loop like this

Sub test()
Dim sh As Worksheet
For Each sh In ActiveWindow.SelectedSheets
MsgBox sh.Name
Next
End Sub
 

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