View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steve R[_3_] Steve R[_3_] is offline
external usenet poster
 
Posts: 11
Default 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