Suppose you want to record a macro to open workbooks you use every day when you start Excel. You can create an Auto_Open macro to do that. You may also want to run a macro automatically when opening a workbook.
Before you get started, make sure the Developer tab is shown on the ribbon. If it's not there, do the following:
-
Click File > Options > Customize Ribbon.
-
Under Customize the Ribbon, in the Main Tabs box, check the Developer box.
-
Click OK.
To open workbooks automatically when Excel starts:
-
Click Developer > Record Macro.
-
In the Macro name box, type Auto_Open.
-
In the Store macro in box, pick Personal Macro Workbook.
-
This will make the macro available every time you open Excel.
-
To remind you what this macro does, enter a description in the Description box. You can also leave this box blank.
-
Click OK.
-
Click File > Open, and select the files you work on every day. The files can be in multiple locations. Press Shift to select multiple files in the same folder.
-
Click Developer > Stop Recording.
-
When you close Excel, you'll eventually be prompted to save the changes you've made to the Personal Macro Workbook. Click Yes so that your macro will run whenever you start Excel.
Each time you start Excel, the workbooks you included in the macro will automatically open.
No comments:
Post a Comment