Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Assigning macros (Excel XP)

    I'm trying to assign a macro to a command button on a spreadsheet...however, the "Assign Macro" command does not come up in the short cut menu when I right-click the button...how come?

    Thanks,

    Christa

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Assigning macros (Excel XP)

    Is it a command button from the Controls Toolbox?

    The assign macro is from the command button from the FORMs toolbar.

    With the control toolbox items select view code and add the code to the event you want or call the existing routine from the event (eg the click event)

    Steve

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    New York, New York, USA
    Posts
    266
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Re: Assigning macros (Excel XP)

    Christina:

    Make sure the pointer is not inside the control box but touching the edges. On my version of Excel the pointer turns into a black line with double arrows.
    When you have the proper pointer right click and you should be able to assign you Macro.

    Hint, change Zoom To 200% or even greater so you can better control the pointer.

    Tom Duthie

  4. #4
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Assigning macros (Excel XP)

    Thank you! That was my problem (I obviously have not done this for awhile :-)

    Thanks again

    Christa

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Assigning macros (Excel XP)

    Did you create the button from the Control Toolbox? If so, you don't get an Assign Macro choice with those controls. If you right click on a control from the Control Toolbox when in design mode, the pop up menu should contain a "View Code" button. If you click on this, you will get a VBE window where you can either put the macro code, or a call to the macro if it is in another module, in the click event routine for the button.

    If the control is from the Forms Toolbox, then you must right click in the selection border of the button to get the "Assign Macro" button in the popup menu.
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •