Macro to button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know how to design a button, and I know how to record a macro but I can't
figure out how to attach the macro to the button?
 
Fritz,

In order to attach a macro to your button, open the Visual Basic editor
(Shift-F11) then click on the sheet containing the button, then click the
down arrow of the combobox showing General, and select your button. Normally
Excel will create a new routine called Private Sub CommandButton1_Click().
Simply insert the name of your macro with ventual parameters below that line.
If you want to associate your macro to another event of this button, select
the event on the second combobox at the top.

Stephane.
 
Fritz,
Right click on any blank area of the "Menu bar" and choose "Customize..."
In the resulting "Customize" dialog box with the "Commands" tab selected
under "Categories:" choose "Macros"
In the right hand pane, drag the smiley face button to where ever you want
it on your menu bar or in your menus.
DO NOT close the "Customize" dialog box.
Right click the new smiley button, at the bottom of the list is "Assign
Macro..."
The "Assign Macro" dialog box opens with your list of macros to choose form.
Hope this helps.
-Kevin
 
I don't think this is what I want. I want to design/draw my own "box" on a
woorksheet. Then I want to assign a macro to it to print the "print area" of
the work sheet.
 
You can use any object you want and assign a macro to it.

A picture, a piece of Wordart, a button from the Forms Toolbar, a drawing from
the Drawing toolbar, a photo of your mother.................


Gord Dibben MS Excel MVP
 
Back
Top