Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel macro enable in all workbooks 1

Status
Not open for further replies.

cramd

Programmer
Mar 28, 2001
214
US
I have an excel macro but would like to enable it work when any workbook/worksheet is opened. Right now, it only opens and runs with the worksheet where I created it. What am I missing?

Diane
 
You need to store the macro in a workbook which is opened all the time. Excel provides a method to set such a book and refer to it as your personal macro workbook(filename personal.xls). You can create such a workbook manually or have Excel create it for you. To use the latter approach, goto Tools, Macro, Record New Macro, and then in the dialog box you should see a dropdown box with [bold]Store Macro in[/bold]. Click on this and select Personal Macro Workbook.

Proceed to record the macro, (anything will do, you can remove it later). When you have stopped recording, goto Windows,Unhide and you should see an entry for Personal.xls. No need to unhide, but exit excel and when asked to save changes to this file accept.

When you re-open excel, itt should be opened automatically but hidden. This is the workbook that you should use for any macros which you want as global, i.e. available to all workbooks. You can copy any existing macros you have into a module of personal.xls and have them available.

A.C.
 
Thank you for those detailed instructions. I read something about the personal workbook but wasn't sure how to create it. Your post will definitely help!!

Diane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top