Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA - identifying which worksheet is active
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 IO have after the active one. Many thanks and best wishes. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA - identifying which worksheet is active
Sub which()
Dim n As String n = ActiveSheet.Name i = 1 For Each w In Worksheets If w.Name = n Then MsgBox (i) End If i = i + 1 Next End Sub -- Gary''s Student - gsnu200753 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA - identifying which worksheet is active
Many thanks for the suggestion. This would definately work but is more
complicated than I had hoped for. I was hoping Index would work but I get an error message when I try that - might of course be my typing. Anyway, thanks for the suggestion. Best wishes, Boris. "Gary''s Student" wrote: Sub which() Dim n As String n = ActiveSheet.Name i = 1 For Each w In Worksheets If w.Name = n Then MsgBox (i) End If i = i + 1 Next End Sub -- Gary''s Student - gsnu200753 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA - identifying which worksheet is active | Excel Programming | |||
Identifying cursor in active spreedsheet | Excel Worksheet Functions | |||
Identifying the Active Fill Color | Excel Discussion (Misc queries) | |||
Identifying the Active Fill Color | Excel Programming | |||
Identifying the active cell | Excel Programming |