• Assign a Macro to a Button (Excel 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Assign a Macro to a Button (Excel 2000)

    Author
    Topic
    #382769

    Hi,
    This is a stupid question but I cannot find the answer, I want to assign a macro to a button, I have done it in a previous version, in Excel 2000 I cannot see any option to assign the macro. What have I missed. I created the button from the toolbar, I even read the Help

    Viewing 2 reply threads
    Author
    Replies
    • #650096

      Bring up the “Customize toolbar” (Menu > Tools > Toolbars > Customize). Then you should be able to right-click on the button and at the bottom should be a menu item “Assign macro…” Is it not there?

      If it is, then releasing the mouse will bring up the macro listing box. Select the one you want and click okay. The box will disppear. Then close the customize toolbar dialog box.

    • #650102

      Here’s the screenshot I was obsessively working on until rudely called on to do actual work, during which time Shades beat me to it. grin

      • #650797

        Hi Guys,

        Thanks for the info but this is not what I need, what I need to do is put a command button on a sheet and assign the macro to that button, not one on the toolbar.

        Thanks

        Mike

        • #650814

          I would advise to use the button from the forms toolbar, it is simpler the the one from the control toolbox (which is more fancy though)

          • #650818

            Thanks Jan

            I need to put it on the sheet as I have to give this to a user and do not want to go around setting up buttons on tool bars.

            Regards

            Mike

            • #650827

              The command buttons on the FORMS toolbar can be added to the worksheet.
              Steve

            • #650829

              Thanks Jan,

              I missed read what you said, I have now used the Forms button and it does what need.

              Many thanks

              Mike

          • #650835

            Thanks Jan

            I need to put it on the sheet as I have to give this to a user and do not want to go around setting up buttons on tool bars.

            Regards

            Mike

    • #650117

      Perhaps you mean a command button from the Control Toolbox, in which case you cannot directly assign a macro. When you add such a button to a worksheet you can right click on it and select View Code. You should then be presented with the following two lines,

      Private Sub CommandButton1_Click()

      End Sub

      between which you can type the name of the macro you wish to invoke, assuming it is a Public Sub.

      Or alternatively you can use a button from the Forms toolbar, to which you can directly assign a macro.

      Andrew C

      • #650805

        Hi Andrew,

        This is what I want to do, but I have always assigned the macro to the button, I have many examples of this, has it changed for Excel 2000.

        Regards

        Mike

        • #650813

          The command button in the FORMS toolbar has an “assign macro” item. The one in CONTROLS toolbox is done throough a click event.

          Steve

          • #650830

            Hi Steve,

            This is where it is, many thanks.

            Regards

            Mike

    Viewing 2 reply threads
    Reply To: Assign a Macro to a Button (Excel 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: