ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do you use a button to launch a macro? (https://www.excelbanter.com/excel-programming/425505-how-do-you-use-button-launch-macro.html)

Jerry

How do you use a button to launch a macro?
 
Using a button and not an object, I want to launch Macro 1 if the Button 1 is
clicked on by the user, and I want to launch Macro 2 if Button 2 is clicked.
I want to use button controls so the button is marked when selected. Can
anyone help?

FSt1

How do you use a button to launch a macro?
 
hi
first..what are you calling a button? an icon on the toobar?? or a command
button from the control toolbox? or a command button from the forms toolbox?
what version of excel are you using????
assuming that you have already written the maco and are using 2003 or
earlier....
icon...
right click any toolbar. right click the icon. click assing macro. follow
the wizzard.
control toolbox...
in design mode. right click the button. from the popup, click view code.
paste the macro there or....
Private Sub CommandButton1_Click()
Call mymacro
End Sub
forms tool box.(not recomended if not on a form).....
from the assing macro dialog, select your macro..click ok.

post back if i missed something.
regards
FSt1


"Jerry" wrote:

Using a button and not an object, I want to launch Macro 1 if the Button 1 is
clicked on by the user, and I want to launch Macro 2 if Button 2 is clicked.
I want to use button controls so the button is marked when selected. Can
anyone help?


FSt1

How do you use a button to launch a macro?
 
hi
it's 1:30 am in atlanta. i'm about to crash. if you do post back, i'll have
a look at it tomorrow.

regards
FSt1

"FSt1" wrote:

hi
first..what are you calling a button? an icon on the toobar?? or a command
button from the control toolbox? or a command button from the forms toolbox?
what version of excel are you using????
assuming that you have already written the maco and are using 2003 or
earlier....
icon...
right click any toolbar. right click the icon. click assing macro. follow
the wizzard.
control toolbox...
in design mode. right click the button. from the popup, click view code.
paste the macro there or....
Private Sub CommandButton1_Click()
Call mymacro
End Sub
forms tool box.(not recomended if not on a form).....
from the assing macro dialog, select your macro..click ok.

post back if i missed something.
regards
FSt1


"Jerry" wrote:

Using a button and not an object, I want to launch Macro 1 if the Button 1 is
clicked on by the user, and I want to launch Macro 2 if Button 2 is clicked.
I want to use button controls so the button is marked when selected. Can
anyone help?


ryguy7272

How do you use a button to launch a macro?
 
Take a look at this:
http://www.anthony-vba.kefra.com/vba/vbabasic1.htm

Regards,
Ryan---

--
RyGuy


"FSt1" wrote:

hi
it's 1:30 am in atlanta. i'm about to crash. if you do post back, i'll have
a look at it tomorrow.

regards
FSt1

"FSt1" wrote:

hi
first..what are you calling a button? an icon on the toobar?? or a command
button from the control toolbox? or a command button from the forms toolbox?
what version of excel are you using????
assuming that you have already written the maco and are using 2003 or
earlier....
icon...
right click any toolbar. right click the icon. click assing macro. follow
the wizzard.
control toolbox...
in design mode. right click the button. from the popup, click view code.
paste the macro there or....
Private Sub CommandButton1_Click()
Call mymacro
End Sub
forms tool box.(not recomended if not on a form).....
from the assing macro dialog, select your macro..click ok.

post back if i missed something.
regards
FSt1


"Jerry" wrote:

Using a button and not an object, I want to launch Macro 1 if the Button 1 is
clicked on by the user, and I want to launch Macro 2 if Button 2 is clicked.
I want to use button controls so the button is marked when selected. Can
anyone help?



All times are GMT +1. The time now is 04:37 PM.

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