ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running a Command Button from a different sheet (https://www.excelbanter.com/excel-programming/303991-running-command-button-different-sheet.html)

Lester Lee

Running a Command Button from a different sheet
 
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!

Simon Lloyd[_525_]

Running a Command Button from a different sheet
 
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

--
Message posted from http://www.ExcelForum.com


Lester Lee

Running a Command Button from a different sheet
 
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!

Simon Lloyd[_527_]

Running a Command Button from a different sheet
 
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

--
Message posted from http://www.ExcelForum.com


Lester Lee

Running a Command Button from a different sheet
 
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!

jordanctc[_6_]

Running a Command Button from a different sheet
 
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

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:08 PM.

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