ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running a Macro from a Command Button (https://www.excelbanter.com/excel-programming/349182-running-macro-command-button.html)

sammy2x

Running a Macro from a Command Button
 

Hi,

I've been using excel for a while, but never really used VB. I have
recorded a Macro, and all I want to do is put a command button on the
sheet to run the Macro, ameteur question I know, but I have no idea how
to write the VB Script!!

Cheers,



Sam.


--
sammy2x
------------------------------------------------------------------------
sammy2x's Profile: http://www.excelforum.com/member.php...o&userid=29674
View this thread: http://www.excelforum.com/showthread...hreadid=496922


Bob Phillips[_6_]

Running a Macro from a Command Button
 
Invoke the forms toolbar (ToolsCustomize and check forms) and there is a
command button on there that you drag onto the worksheet. As you do, it will
throw up a dialog asking to assign a macro.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"sammy2x" wrote in
message ...

Hi,

I've been using excel for a while, but never really used VB. I have
recorded a Macro, and all I want to do is put a command button on the
sheet to run the Macro, ameteur question I know, but I have no idea how
to write the VB Script!!

Cheers,



Sam.


--
sammy2x
------------------------------------------------------------------------
sammy2x's Profile:

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




Jim Rech

Running a Macro from a Command Button
 
My preference is to use a button from the Forms toolbar rather than the
Control Toolbox equivalent. If you go that way, after you draw the button
on a sheet the Assign Macro dialog will appear automatically and all you
have to do is click on the name of your recorded macro.

--
Jim
"sammy2x" wrote in
message ...
|
| Hi,
|
| I've been using excel for a while, but never really used VB. I have
| recorded a Macro, and all I want to do is put a command button on the
| sheet to run the Macro, ameteur question I know, but I have no idea how
| to write the VB Script!!
|
| Cheers,
|
|
|
| Sam.
|
|
| --
| sammy2x
| ------------------------------------------------------------------------
| sammy2x's Profile:
http://www.excelforum.com/member.php...o&userid=29674
| View this thread: http://www.excelforum.com/showthread...hreadid=496922
|




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

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