Assign Macro

G

Guest

Hello,

I am trying to assign a Macro, that I have recorded, to a command button. When I right-click on one of the sizing handles isn't Assign Macro supposed to appear in the shortcut menu? I still haven't found anything where I can assign a Macro.
Really thankful for all your help!

/Anna
 
G

Guest

Anna,

I think the problem may be that there are two different command buttons you may be using.

Case 1: you're putting the command button on a form. Or you're putting a button right on your spreadsheet, but you're using the "form" toolbar to do it.

In this case all you get is the ability to add code to the button. Now if you've already created a macro that you want to use, you can run that from the code that gets attached to the button. For example, if you already have a macro, Macro1, that you want to run, you can do the following:

Private Sub CommandButton1_Click()
Macro1
End Sub

And this code would be in the sheet or on the form in which your button appears.

Case 2: You're putting a button directly on your spreadsheet and using the "control" toolbar to get the button. In this case, right clicking should get you the ability to assign a macro to the button.

I hope this helps.

Art
 
J

Jan Karel Pieterse

Hi Anna,
I am trying to assign a Macro, that I have recorded, to a command button. When I right-click on one of the sizing handles isn't Assign Macro supposed to appear in the shortcut menu? I still haven't found anything where I can assign a Macro.

Depends on the kind of button you used. Assigning macros is limited to the button from the Forms toolbar.
Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com
 
M

Mike A

Right-click on any of your toolbars and select Customize...

While the dialog is open, click on the button (on your toolbar in your
Excel window) you want to assign the macro to. Click Modify Selection
in the dialog box, Assign Macro is at the bottom of the list.



Mike Argy
Custom Office Solutions
and Windows/UNIX applications

Please post on-topic responses to the newsgroup

To e-mail me, remove nospam from the address in the headers
 
G

Guest

I thank everyone for the help...I had the exact same problem and it was
solved by reading these boards.
SUE
 
G

Guest

Same here,
spent two days trying to find why i cannot get the assing macro on the menu
, but thank you to you guys now its solved .

Well Done guys
Anton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top