Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default 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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default 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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Launch MS Access DB from a button in Excel deeds Excel Programming 11 September 30th 08 07:57 PM
How do I launch my macro by button? Steven Excel Programming 1 October 24th 05 11:33 PM
Is it possible to make a Button on a tool bar to launch an Add-in Wolf Excel Discussion (Misc queries) 1 June 24th 05 12:13 AM
Macro launch - Button vs Manual launch , has different results. Wayne Excel Programming 4 February 23rd 05 11:33 AM
button to launch my userform JasonSelf[_6_] Excel Programming 2 January 26th 04 04:11 PM


All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"