LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Sheet number

Just what I needed! Thanks guys. I am rather new at
this.

Glen

-----Original Message-----
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


--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message

...
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

-----Original Message-----
Hi Glen,

Try:

Activesheet.Index

---
Regards,
Norman



"Glen" wrote in

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

Thanks
Glen


.



.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare sheet 1 column A numbers with sheet 2 column A number Not and Excel Expert Excel Worksheet Functions 3 November 20th 18 08:24 AM
Macro to lookup a sheet, number, then display in origonal sheet abbsy3 New Users to Excel 3 November 9th 10 12:19 PM
How can I refer to sheet number not sheet (name)? DK Excel Worksheet Functions 2 March 30th 09 11:06 PM
Using the Indirect function with a sheet number instead of a sheet name JDB Excel Worksheet Functions 5 December 31st 05 03:03 PM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM


All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"