ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Marco and command buttons (https://www.excelbanter.com/excel-programming/349814-marco-command-buttons.html)

sarasotavince

Marco and command buttons
 

If I have recorded a macro and saved it as test1 and want to run the
macro from a command button, how do I associate the saved macro test1
with the button? Thanks.


--
sarasotavince
------------------------------------------------------------------------
sarasotavince's Profile: http://www.excelforum.com/member.php...o&userid=30237
View this thread: http://www.excelforum.com/showthread...hreadid=499104


Tom Ogilvy

Marco and command buttons
 
put the sheet in design mode by clicking the control toolbox toolbar upper
left button. Then double click on the command button or right click on it
and select view code. You will want to see code like

Private Sub CommandButton1_Click()
Test1
End Sub


or move all the code but the declaration and end statement in the Click
event.

--
Regards,
Tom Ogilvy

"sarasotavince"
wrote in message
news:sarasotavince.21anja_1136686802.021@excelforu m-nospam.com...

If I have recorded a macro and saved it as test1 and want to run the
macro from a command button, how do I associate the saved macro test1
with the button? Thanks.


--
sarasotavince
------------------------------------------------------------------------
sarasotavince's Profile:

http://www.excelforum.com/member.php...o&userid=30237
View this thread: http://www.excelforum.com/showthread...hreadid=499104





All times are GMT +1. The time now is 05:41 PM.

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