Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command Button & Macro

I have a macro that I'd like to somehow attach to a command button i
created in one of my cells. How do I attach a macro?


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Command Button & Macro

alexm999,

I assume that you used a command button from the "Controls Toolbox"
The "Forms" one would have asked you to assign the macro when you
created the button. You could just delete the button that you have and
use one from the "Forms" toolbar.
Or, if you want to keep the one you have.....
Right click on it.
Select "View Code"
Between the Sub and End Sub, just type in the name of your macro.

John

"alexm999 " wrote in message
...
I have a macro that I'd like to somehow attach to a command button i
created in one of my cells. How do I attach a macro?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Command Button & Macro

Hi Alex

On a button from the Forms Toolbar you can right click and assign a macro

If you have a button from the controltoolbox
Press the first button on the controltoolbox toolbar to go into the design mode
Double click on the button you placed on your worksheet.
The VBA editor will open with this

Private Sub CommandButton1_Click()

End Sub

You can place the code in the event or place the macroname in the event.
Press Alt-q to go back to Excel and press the first button on the controltoolbox again to exit the design mode



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"alexm999 " wrote in message ...
I have a macro that I'd like to somehow attach to a command button i
created in one of my cells. How do I attach a macro?


---
Message posted from http://www.ExcelForum.com/



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
Use Macro To Change Which Macro Assigned To Command Button CVinje Excel Discussion (Misc queries) 0 May 25th 10 09:55 PM
Command Button and macro Bob[_16_] Excel Discussion (Misc queries) 4 June 12th 09 03:51 AM
Run a macro using a command button Tdahlman Excel Discussion (Misc queries) 9 March 5th 08 07:59 PM
Command Button to run a Macro Mark Allen Excel Worksheet Functions 2 June 4th 07 04:24 PM
Macro for command button wcmar10 Excel Programming 0 July 30th 03 09:26 PM


All times are GMT +1. The time now is 02:24 PM.

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

About Us

"It's about Microsoft Excel"