View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ronald Dodge Ronald Dodge is offline
external usenet poster
 
Posts: 111
Default Assigning Macros

Okay, I have noticed this too in the past, though I forget exactly what it
was that caused the issue as it was in XL97. However, there is a way to get
around this. Follow the steps below:

If you don't have the Visual Basic toolbar up, bring it up.
To bring this up, right click in the toolbar area of the application,
then select "Visual Basic".

Have the Design button pressed in by clicking on it.

Right Click on your command button and then click on "View Code"
This will take you into the Visual Basic Editor with the Command button
shown in the upper left box.

In the upper right box, select the "Click" Event, if it's not already
selected.
This will automatically create a Private Sub command for the command
button's Click event.

In between the "Private Sub" and "End Sub" lines, put in the name of the
macro that you want assigned to the command button, provided it's within the
same workbook as the command button, otherwise, you will need to put in the
macro name in the following syntax:

<WorkbookName!<ModuleName.<MacroName

Note: <WorkbookName is the name of the workbook which is case sensitive
and must include the 3 letter extension. <ModuleName is the name of the
Module/Object that the macro is part of

Examples:

Book1.xls!Worksheets("Sheet1").MyMacro
Book1.xls!Module1.MyMacro2

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"T F Hewitt" wrote in message
...
I have recorded a Macro and created a command button but I
can not figure how to assign the macro top the command
button. I have follow MS instructions as far as right
clicking the sizing corners for the short cut menu but I
do not get the option on the shortcut menu to assign
Macro. I must not have something set right and MS assumes
to much in their directions

Thanks for any help.

Tom