![]() |
identify active sheet
I am trying to identify my currently active sheet name.
If sheets(ActiveSheet) = sheets("first sheet") Then a=1 ElseIf sheets(ActiveSheet) = sheets("second sheet") Then a=2 End If this does not work. I have tried many variations of the first line, but no luck. any ideas? thx |
identify active sheet
This should help:
sub Check() MsgBox ActiveSheet.Name MsgBox Sheets(1).Name end sub "mike allen" wrote in message ... I am trying to identify my currently active sheet name. If sheets(ActiveSheet) = sheets("first sheet") Then a=1 ElseIf sheets(ActiveSheet) = sheets("second sheet") Then a=2 End If this does not work. I have tried many variations of the first line, but no luck. any ideas? thx |
All times are GMT +1. The time now is 10:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com