active worksheet

  • Thread starter Thread starter scrabtree23
  • Start date Start date
S

scrabtree23

I want to write a code to do one thing if one sheet
is "active" and another thing is a different sheet
is "active". I envision it something like this:

If ActiveSheet= sheets("Travel") Then
(Code)
End If

SDC
 
Try something like this

Sub test()
sh = ActiveSheet.Name
Select Case sh
Case "Sheet1"
MsgBox "Sheet1"

Case "Sheet2"
MsgBox "Sheet2"

Case "Sheet3"
MsgBox "Sheet3"
End Select
End Sub
 
Back
Top