Display MsgBox when selecting a sheet

  • Thread starter Horatio J. Bilge, Jr.
  • Start date
H

Horatio J. Bilge, Jr.

Is there a way that I can have a message box display whenever a particular
sheet is selected?

Thanks,
~ Horatio
 
M

Mike H

Horatio,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Activate()
msg = "You activated "
MsgBox msg & ActiveSheet.Name
End Sub

Mike
 
J

JW

Right click on the sheet tad where you want this to happen and select
View Code. Then paste in the code below. Modify the message box as
needed.
Private Sub Worksheet_Activate()
MsgBox "your stuff here!"
End Sub
 
H

Horatio J. Bilge, Jr.

Thanks. It works great.
I was trying to use Workbook_SheetChange, but then I got the message for all
sheets, and I didn't know how to isolate the single sheet.

~ Horatio
 
Top