Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Is there a way to make a macro run when I click on a specific worksheet?
|
#2
![]() |
|||
|
|||
![]()
You can tap into the worksheet_activate event.
Rightclick on the worksheet tab that should have this behavior. Select view code and paste this in: Option Explicit Private Sub Worksheet_Activate() MsgBox "Hi there from: " & Me.Name End Sub Now whenever you swap from a different worksheet in the same workbook to this worksheet, you'll get a message saying "hi". If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm You can read more about events at: Chip Pearson's site: http://www.cpearson.com/excel/events.htm David McRitchie's site: http://www.mvps.org/dmcritchie/excel/event.htm Cheryl wrote: Is there a way to make a macro run when I click on a specific worksheet? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula for current month minus one = Quarter number in a macro. | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) |