alanw64
New Member
- Joined
- Jun 1, 2009
- Messages
- 6
Ok, I might be making this harder than it seems, but after multiple searches here and elsewhere, I can't seem to find the answer.
I have a macro that will add multiple worksheets. When the worksheet is added, is there a way to dynamically create code inside the Worksheet_Activate event procedure? The macro dialogbox will remain open (non-modal form), and ideally, if the user switches to another worksheet, I would like the macro dialogbox to know about it via the Worksheet_Activate event. Is that possible?
Basically, I would like my macro to create the following code for every worksheet that gets added:
Private Sub Worksheet_Activate()
Call MyMacroEvent
End Sub
I started reading about the VBA extensibility and the VBE, but I'm not sure if that's what I need or not. Hopefully there's an easier solution!
Thank you for any input,
Alan
I have a macro that will add multiple worksheets. When the worksheet is added, is there a way to dynamically create code inside the Worksheet_Activate event procedure? The macro dialogbox will remain open (non-modal form), and ideally, if the user switches to another worksheet, I would like the macro dialogbox to know about it via the Worksheet_Activate event. Is that possible?
Basically, I would like my macro to create the following code for every worksheet that gets added:
Private Sub Worksheet_Activate()
Call MyMacroEvent
End Sub
I started reading about the VBA extensibility and the VBE, but I'm not sure if that's what I need or not. Hopefully there's an easier solution!
Thank you for any input,
Alan