Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mickey Blue Eyes
 
Posts: n/a
Default How to assign a macro to a commnd button

I have created a Macro to perform the task of taking the user from one
worksheet to another upon clicking the command button. However when right
clicking on my mouse to view the short cut menu for the command button there
is no option to assign a macro to the button? The options availabl to me are
the format control at the bottom of the short cut menu. How do I activate a
Macro on a command button??
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

You can assign macros in the way you want to buttons created from the
Forms toolbar. You've created a button from the Control Toolbox instead.
You can use the button's _Click() event to call your macro:

Sub CommandButton1_Click()
MyMacro
End Sub

In article ,
"Mickey Blue Eyes" <Mickey Blue wrote:

I have created a Macro to perform the task of taking the user from one
worksheet to another upon clicking the command button. However when right
clicking on my mouse to view the short cut menu for the command button there
is no option to assign a macro to the button? The options availabl to me are
the format control at the bottom of the short cut menu. How do I activate a
Macro on a command button??

  #3   Report Post  
 
Posts: n/a
Default

In disign mode,right click the button then select view
code. If you have already written the macro you can use
the Call command to run it. sample code below.

Private Sub CommandButton1_Click()
Call YourMacro
End Sub
good luck

-----Original Message-----
I have created a Macro to perform the task of taking the

user from one
worksheet to another upon clicking the command button.

However when right
clicking on my mouse to view the short cut menu for the

command button there
is no option to assign a macro to the button? The options

availabl to me are
the format control at the bottom of the short cut menu.

How do I activate a
Macro on a command button??
.

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
Assign Macro SUE M Excel Discussion (Misc queries) 1 September 22nd 07 09:00 PM
Destroy command button with a Macro? grasping@straws Excel Discussion (Misc queries) 3 December 22nd 04 02:30 PM
Assign Macro to button in Excel doesnt work Any ideas? Mike@Becketts Excel Discussion (Misc queries) 2 December 20th 04 02:47 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
assign a macro to a control button ewan72 Excel Discussion (Misc queries) 1 December 3rd 04 02:04 PM


All times are GMT +1. The time now is 01:40 AM.

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"