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?
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.
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!!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.