Running a Command Button from a different sheet

L

Lester Lee

I need call a command button to run in another sheet form the sheet that
I am in. Does anyone have a code for this?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Simon Lloyd

Lester,

You should supply the code you are using for your command butto
explain what it is that it does and what exactly you would like to do
you will probably find that there will be loads of help then.

Failing that, select Tools, Macros then click the macro you want onc
then choose Options and assign it a keyboard shortcut, this macro wil
then run in any sheet where you use the keystrokes!, but bear in min
that the shortcut keystroke cannot be the same as one already used b
excel or yourself.

Simo
 
L

Lester Lee

Okay let me explain this again:

In Sheet1, there is Command Button 1 that Hides or Unhides various rows
depending on varibles in Sheet 1.

In Sheet2, there is Command Button 2 that goes to Sheet1.

I want to make that Command Button 2 in Sheet 2, run the Hide and unhide
procedures as if I had clicked on Command Button 1.

Sorry for the confusion earlier.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Simon Lloyd

Lester as far as i am aware you just call that routine in the code fo
your command button 2 so you could write some code like

Sub sheet1 ()

ENTER THE CODE THAT DOES WHAT YOU NEED HERE

End Sub

then assign the macro to the command button.

but i am still unsure as to what you are trying to do?

Simo
 
L

Lester Lee

Okay, what I want to do is make CommandButton 1 execute the procedure in
CommandButton 2 without have to copy the code into CommandButton1,
effectively I want to 'Click' CommandButton2 from CommandButton1.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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

Top