![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 33
|
Just wondering what the code is to run a designated macro from an embedded button. For example, I have a macro "Calc" written in a module and instead of copying and pasting the code into the Button Click sub, can I write a "trigger" that runs that macro?
Basically > Click Button > Button "calls" the Calc macro (and then any other macros I may want to run) Thanks in advance! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
hi, to call the calc macro from a button, you need to create a macro with the code
Call Calc then, assign this macro to the button. Will |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 33
|
No, I don't want to run the macro from a toolbar button, I want to run it from a coded embedded button.
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
how d'you mean?
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2002
Posts: 33
|
I want to create a command button on my worksheet. Inside the code of that command button, I want to trigger a macro.
ie. Private Sub CommandButton1_Click() "Trigger macro from here" End Sub |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
can i ask why it needs to be within the actual button and not a macro connected to the button?
|
|
|
|
|
|
#7 |
|
New Member
Join Date: Mar 2002
Posts: 33
|
That's just it... I want to know If I am able to call other macros from the code in a command button. This way I can call 2 or 3 macros by just clicking the button I have embedded.
|
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
well yes then, you should be able to. have you tried with the call command?
|
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
well yes then, you should be able to. have you tried with the call command?
|
|
|
|
|
|
#10 |
|
New Member
Join Date: Mar 2002
Posts: 33
|
That's what I'm after... the syntax. What is the syntax for the call command?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|