PC Review


Reply
Thread Tools Rate Thread

click in a workbook

 
 
greg
Guest
Posts: n/a
 
      17th Dec 2007
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


 
Reply With Quote
 
 
 
 
greg
Guest
Posts: n/a
 
      17th Dec 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I toggle between sheets in a workbook without having to click? soconfused Microsoft Excel Misc 6 2nd Dec 2009 10:59 PM
Double Click will not open my Workbook =?Utf-8?B?U3RhY3k=?= Microsoft Excel Misc 3 13th Apr 2006 07:06 PM
One click workbook email? Drew Microsoft Excel Worksheet Functions 7 4th Aug 2004 02:22 PM
Open another workbook with a button click celia Microsoft Excel Misc 4 29th Apr 2004 02:38 AM
Re: Dbl Click only opens the program, not the workbook Frank Kabel Microsoft Excel Misc 0 24th Mar 2004 10:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:36 AM.