Wednesday, February 20, 2008

How to Create a Toolbar Button for an Existing Macro

1. Go to Start>Programs>Microsoft Excel to open the application. Go to File>New and open a new spreadsheet.

macro button image

2. Go to Tools>Customize and select it.

macro button image

3. A pop-up menu window called “Customize” will appear, click on the “Toolbar” tab and select the toolbar where you want the macro button to appear. For this tutorial, we want the macro button to be accessible and visible in the “Standard” toolbar, so check the box for the Standard toolbar.

macro button image

4. Now click on the “Commands” tab and select a category – the kind of function you will be creating as a button. Go down and select “macros.” The Commands window to the right of the pop-up window appears with two options: Custom Menu Item or a Custom Button.

macro button image

5. Click on the “Custom Button” (it looks like a happy face) option and drag it to the standard toolbar (located at the top of the screen under the different menu options - File, Edit, etc.), place it right next to the “Save” button so it is easy to locate.

macro button image

6. Now click on the new macro button and a pop-up window called “Assign Macro” will appear. Here select the actual macro that will be assigned to this button, so for this tutorial we’ll use one already created called “PERSONAL.XLS!.ht” macro and hit OK.

macro button image

macro button image

7. Finally, we’ll test the new custom macro button. Go to File>New to open a new spreadsheet, and click on the newly created macro button located on the standard toolbar to the right of the “Save” button. After clicking the button, you will see the names of ten training managers automatically appear.

macro button image

macro button image

Great! wasn’t it super easy. You can basically follow the same steps to add a button for any function other than a macro. Remember to keep practicing because the more you do it, the better you will get.        

Posted by Babai at 13:54:57 | Permalink | No Comments »

Create a macro button in Microsoft Excel

The following directions were written using Microsoft Excel 2000. Instructions for other versions may differ slightly.

  1. Open a new workbook.
  2. From the Tools menu, choose Customize, as shown in Figure A.

Figure A

  1. Click the Commands tab and then scroll down the left-hand Categories column and select Macros (see Figure B).
  2. You’ll see Custom Button in the Commands box. Click, hold, and drag the custom button onto any toolbar and release, as shown in Figure B.

Figure B

  1. Right-click the new button and choose Assign Macro.
  2. Choose HeaderFooter and click OK. You may now change the button icon by right-clicking the button, choosing Change Button Image, and clicking on another icon, as shown in Figure C.

Figure C

  1. Close the Customize dialog box.

You may now run your macro by clicking the button you’ve created. It will be available from all workbooks.

Create a macro button in Microsoft Word
Creating a macro button in Microsoft Word is similar to creating one in Excel. The following directions were written using Microsoft Word 2000. Instructions for other versions may differ slightly. Before starting the steps below, I created a macro, named PasteText, to paste unformatted text in Word documents. To create a macro button:

  1. Open a new document.
  2. From the Tools menu, choose Customize.
  3. Click the Commands tab and then scroll down in the Categories box and select Macros (see Figure D). You’ll see the names of any macros you’ve created in the Commands box on the right-hand side.
  4. Click, hold, and drag your macro onto any toolbar and release, as shown in Figure D. A button with the name of the macro will appear on the toolbar.

Figure D

  1. To associate an icon with this button, right-click it, choose Change Button Image, and click on any icon (see Figure E).

Figure E

  1. Next, right-click the button and choose Default Style. Your button will now appear as an icon only.

You may run your macro by clicking the button you’ve created. It will be available from all documents.

Posted by Babai at 13:47:26 | Permalink | No Comments »