ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run a macro using a command button (https://www.excelbanter.com/excel-discussion-misc-queries/178824-run-macro-using-command-button.html)

Tdahlman

Run a macro using a command button
 
I have created a macro using the Macro Recorder.
I have a command button and I want to run the macro (which is names
DATASORT) when I click the button.

Please advise how to make this work.

Thanks in advance,
Travis

PCLIVE

Run a macro using a command button
 
This will depend on the type of command button you created. Right-click
your command button. If there is an option to "Assign Macro", then that's
how you do it. If not, then click "View Code"

Enter this text.

Call <your macro name, no brackets


HTH,
Paul

--

"Tdahlman" wrote in message
...
I have created a macro using the Macro Recorder.
I have a command button and I want to run the macro (which is names
DATASORT) when I click the button.

Please advise how to make this work.

Thanks in advance,
Travis




Jason

Run a macro using a command button
 
Go to "View" & "Toolbars". Show the forms toolbar.

Click the "button" button. (I know it doesn't make sense, but if you hover
your cursor over, it will say "button")

You'll get a cursor where you can drag & drop a button.

Once you have the button, right click & choose "assign macro".

"Tdahlman" wrote:

I have created a macro using the Macro Recorder.
I have a command button and I want to run the macro (which is names
DATASORT) when I click the button.

Please advise how to make this work.

Thanks in advance,
Travis


FSt1

Run a macro using a command button
 
hi
on the toolbox toolbar, chick design mode. the icon looks like a protractor
with ruller and pencil. in design mode right click the button. from the
popup, click view code. add this......
Private Sub CommandButton1_Click()
call DATASORT
End Sub
close the vb window.
if you need to relocate or resize the button, do so now.
click design mode icon again to exit design mode.
done. button is live.

Regards
FSt1
"Tdahlman" wrote:

I have created a macro using the Macro Recorder.
I have a command button and I want to run the macro (which is names
DATASORT) when I click the button.

Please advise how to make this work.

Thanks in advance,
Travis


Bob I

Run a macro using a command button
 


FSt1 wrote:

hi
on the toolbox toolbar, chick design mode.

--------------------------^^^^^^^^^^^^^^^^^
What version you got, and where can I get one?! ;-)


FSt1

Run a macro using a command button
 
hi
2002
on the menu bar...
toolcustomizetoolbarscheck control toolbox

regards
FSt1

"Bob I" wrote:



FSt1 wrote:

hi
on the toolbox toolbar, chick design mode.

--------------------------^^^^^^^^^^^^^^^^^
What version you got, and where can I get one?! ;-)



PCLIVE

Run a macro using a command button
 
You missed it! You typed "chick design mode".
-------------------

--

"FSt1" wrote in message
...
hi
2002
on the menu bar...
toolcustomizetoolbarscheck control toolbox

regards
FSt1

"Bob I" wrote:



FSt1 wrote:

hi
on the toolbox toolbar, chick design mode.

--------------------------^^^^^^^^^^^^^^^^^
What version you got, and where can I get one?! ;-)





FSt1

Run a macro using a command button
 
so i can't spell. sigh


"PCLIVE" wrote:

You missed it! You typed "chick design mode".
-------------------

--

"FSt1" wrote in message
...
hi
2002
on the menu bar...
toolcustomizetoolbarscheck control toolbox

regards
FSt1

"Bob I" wrote:



FSt1 wrote:

hi
on the toolbox toolbar, chick design mode.
--------------------------^^^^^^^^^^^^^^^^^
What version you got, and where can I get one?! ;-)






PCLIVE

Run a macro using a command button
 
It's just funny. Wouldn't be great to have a "chick design mode" in Excel.
;-)

--

"FSt1" wrote in message
...
so i can't spell. sigh


"PCLIVE" wrote:

You missed it! You typed "chick design mode".
-------------------

--

"FSt1" wrote in message
...
hi
2002
on the menu bar...
toolcustomizetoolbarscheck control toolbox

regards
FSt1

"Bob I" wrote:



FSt1 wrote:

hi
on the toolbox toolbar, chick design mode.
--------------------------^^^^^^^^^^^^^^^^^
What version you got, and where can I get one?! ;-)








Bob I

Run a macro using a command button
 
Not to worry, please review for humor aspect!

FSt1 wrote:

so i can't spell. sigh


"PCLIVE" wrote:


You missed it! You typed "chick design mode".
-------------------

--

"FSt1" wrote in message
...

hi
2002
on the menu bar...
toolcustomizetoolbarscheck control toolbox

regards
FSt1

"Bob I" wrote:



FSt1 wrote:


hi
on the toolbox toolbar, chick design mode.

--------------------------^^^^^^^^^^^^^^^^^
What version you got, and where can I get one?! ;-)








All times are GMT +1. The time now is 12:55 AM.

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