MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Assign a macro to toolbar

Posted by Rick M on November 19, 2001 6:08 AM

I have a macro that I have assign to a toolbar. The problem is I want the macro to be available for any workbook. I do not have the orginal workbook open when i run the macro, and excel says " the macro cannot be found".
How do I create the macro to be generic to excel and not a specific workbook?


Posted by JAF on November 19, 2001 6:18 AM

If you want a macro to be available to any workbook that you have open, it needs to be in your Personal Macro Workbook (Personal.xls)

If you don't have one of these yet (and Excel doesn't set one up as default, you can create it as follows:
Tools menu, Macros, Record new macro
In the Store macro in box, change this to Personal Macro Workbook
Click OK
Record any action (I suggest you just click in another cell) and then close the macro recorder.

If you now go into the Visual Basic Editor (Alt+F11) your Personal Macro Workbook will be visible in the Project Explorer (Ctrl+R if not currently visible)

Hope this helps.