click in a workbook

  • Thread starter Thread starter greg
  • Start date Start date
G

greg

Hello,
I would like to create controls on different sheet.
But have the event code in the main workbook. And have none in the
worksheets.
Is this possible?
Where I could have a
Workbook_<SOMETHING> event.
Then have a case statment looking for the control name.
If it was CommandButton1 on sheet1 I would look for CommandButton1.
If it was CheckBox1 on sheet5, I would look for CheckBox1.
is this possible?
thanks
 
I thought I could use the WithEvents
so in my workbook have
Private WithEvents CmdBut As CommandButton
then
Private Sub CmdBut_Click()
MsgBox "in thisworkbook"
End Sub

but this does not work

Any help?
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top