Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jock W
 
Posts: n/a
Default Command buttons & macros

How do I allocate a macro to a command button?
Right clicking a command button which is in design mode brings down a drop
down menu but 'assign macro' isn't on option.
--
Jock Waddington
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Jock,

Sounds like you have control toolbox button.. Assuming so, when in design
mode, double-click the button, and then will open up the worksheet code
module, and create a skeleton click event which would be where you add your
code.

--

HTH

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


"Jock W" wrote in message
...
How do I allocate a macro to a command button?
Right clicking a command button which is in design mode brings down a drop
down menu but 'assign macro' isn't on option.
--
Jock Waddington



  #3   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Jock,

Command buttons have their own event handlers. Double-clicking one will
take you to it, something like:

Private Sub CommandButton1_Click()
' you could call your macro in here
' or just put the code here
End Sub

This event handler lives in the sheet module, like worksheet_change and
other events.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Jock W" wrote in message
...
How do I allocate a macro to a command button?
Right clicking a command button which is in design mode brings down a drop
down menu but 'assign macro' isn't on option.
--
Jock Waddington



  #4   Report Post  
Jock W
 
Posts: n/a
Default

Thanks to Bob and Earl. Job done

"Earl Kiosterud" wrote:

Jock,

Command buttons have their own event handlers. Double-clicking one will
take you to it, something like:

Private Sub CommandButton1_Click()
' you could call your macro in here
' or just put the code here
End Sub

This event handler lives in the sheet module, like worksheet_change and
other events.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Jock W" wrote in message
...
How do I allocate a macro to a command button?
Right clicking a command button which is in design mode brings down a drop
down menu but 'assign macro' isn't on option.
--
Jock Waddington




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
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
sorting with macros Sorting in macros Excel Discussion (Misc queries) 1 February 1st 05 09:02 AM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM
The available macros list in XL; how to suppress filename from showing KR Excel Discussion (Misc queries) 1 January 10th 05 07:20 PM
Macros disappear after a file is imported Brent E Excel Discussion (Misc queries) 1 December 18th 04 12:25 AM


All times are GMT +1. The time now is 07:30 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"