Running a Command Button from a different sheet

  • Thread starter Thread starter Lester Lee
  • Start date Start date
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
 
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
 
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.
 
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
 
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.
 
call the subroutine

Sub ButtonInstructionsA()

'Unique Code

End Sub

Sub ButtonInstructionsB()

'Additional Unique Code

Sheets("Sheet1").Select

Call ButtonInstructionsA

Sheets("Sheet2").Select

End B

Maybe this will help,
Jorda
 

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