ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   click in a workbook (https://www.excelbanter.com/excel-programming/402892-click-workbook.html)

greg

click in a workbook
 
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



greg

click in a workbook
 
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


"greg" wrote in message
...
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





All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com