ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   run macro on a CommandButton from another sheet (https://www.excelbanter.com/excel-programming/400389-run-macro-commandbutton-another-sheet.html)

Corey

run macro on a CommandButton from another sheet
 
I am trying to get a macro linked to a commandbutton to run, from another code in another sheet, but
casnnot get the code right.

Tried:

Sheet2.CommandButton2.Select etc to no avail

What is the line of code to run it ?

Corey....



Corey

run macro on a CommandButton from another sheet
 
Nevermind, just worked it out as i placed the post.
Removed the Private from the Commandbutton2 _Click Sub and when i typed in Sheet2.
The Commandbutton2_Click was then listed.
Yay!

Corey....
"Corey" wrote in message ...
I am trying to get a macro linked to a commandbutton to run, from another code in another sheet, but
casnnot get the code right.

Tried:

Sheet2.CommandButton2.Select etc to no avail

What is the line of code to run it ?

Corey....





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

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