#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macro to button

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 53
Default Macro to 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.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Macro to button

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

"Fritz" wrote in message
...
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?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macro to button

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.

"Kevin" wrote:

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

"Fritz" wrote in message
...
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?




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro to button

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

On Sat, 21 Jul 2007 15:46:00 -0700, Fritz
wrote:

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.

"Kevin" wrote:

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

"Fritz" wrote in message
...
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?





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
Using Macro to sort without clicking on macro button dd Excel Discussion (Misc queries) 3 May 3rd 07 06:00 PM
Macro Button Lady Success Excel Worksheet Functions 1 November 12th 06 07:13 PM
Cannot see macro behind button? Kimberly Anne Excel Discussion (Misc queries) 1 August 31st 06 12:00 AM
use macro button to run macro in protected sheet earl Excel Discussion (Misc queries) 3 February 26th 06 10:21 PM
F9 Button Macro Andrew McLeod Excel Discussion (Misc queries) 2 November 23rd 05 11:20 PM


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

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

About Us

"It's about Microsoft Excel"