Automate Excel Macros on Open

Victoria Jul 07, 2026

Ever found yourself repeating the same tasks every time you open Microsoft Excel? Wouldn't it be great if you could automate some of these tasks, saving you time and effort? One way to do this is by creating a macro that runs automatically when Excel opens. Let's explore how you can achieve this.

How to Create Macros in Excel Tutorial
How to Create Macros in Excel Tutorial

Excel macros are a powerful tool that allows you to record and playback a series of actions. They can automate repetitive tasks, making your work more efficient. But how do you make a macro run automatically when Excel opens? This guide will walk you through the process.

Run Macro Automatically on Open - Excel Zoom
Run Macro Automatically on Open - Excel Zoom

Understanding Excel Macros and Startup Options

Before we dive into creating an auto-run macro, let's first understand what macros are and how they interact with Excel's startup options.

How to Run Macro in Excel
How to Run Macro in Excel

Excel macros are stored in the Personal Macro Workbook, which is a hidden workbook that opens every time you start Excel. This workbook is where your macros are stored and can be accessed via the Developer tab in the Ribbon.

Enabling the Developer Tab

How to Record & Run a Macro in Excel (Macros Tutorial for Beginners)
How to Record & Run a Macro in Excel (Macros Tutorial for Beginners)

If you don't see the Developer tab in your Ribbon, you'll need to enable it. Here's how:

1. Right-click on the Ribbon and select 'Customize the Ribbon'.

2. Check the box next to 'Developer' and click 'OK'.

Refresh All Pivot Tables In Financial Dashboards Using Excel Macro Buttons
Refresh All Pivot Tables In Financial Dashboards Using Excel Macro Buttons

Accessing the Personal Macro Workbook

Now that you've enabled the Developer tab, you can access the Personal Macro Workbook:

1. Click on the 'Developer' tab in the Ribbon.

How to Edit a Macro in Excel - Tutorial
How to Edit a Macro in Excel - Tutorial

2. In the 'Code' group, click on 'Visual Basic'.

3. In the Visual Basic for Applications (VBA) window, go to 'Insert' > 'Module'.

5 Cool Microsoft Excel Macros for Sorting Data
5 Cool Microsoft Excel Macros for Sorting Data
how to add a macro to the toolbar in excel - click here to view the course
how to add a macro to the toolbar in excel - click here to view the course
How to Record a Macro in Excel - A Step by Step Guide
How to Record a Macro in Excel - A Step by Step Guide
What is a Macro in Excel??? + How to Make One (with video tutorial)
What is a Macro in Excel??? + How to Make One (with video tutorial)
How to Debug a Macro in Excel (Tutorial)
How to Debug a Macro in Excel (Tutorial)
How to Record a Macro in Excel
How to Record a Macro in Excel
Excel Macros - Hands-on Tutorial For Beginners With Examples
Excel Macros - Hands-on Tutorial For Beginners With Examples
Save Macros In Active Workbook To Clean Up Financial Databases
Save Macros In Active Workbook To Clean Up Financial Databases
How to Make a Macro in Excel - Tutorial
How to Make a Macro in Excel - Tutorial
3 Easy Methods to Create Button in Excel for Macros
3 Easy Methods to Create Button in Excel for Macros
the text autofit rows using macros in excel
the text autofit rows using macros in excel
How to Create Complex Macros in Excel
How to Create Complex Macros in Excel
How to Create & Use Excel Macros (Real world example)
How to Create & Use Excel Macros (Real world example)
Macro to Create New Sheet and Copy Data in Excel (4 Examples)
Macro to Create New Sheet and Copy Data in Excel (4 Examples)
All You Need to Learn about Excel Macros and VBA
All You Need to Learn about Excel Macros and VBA
Macros in Excel with VBA code examples - MacrosInExcel.com
Macros in Excel with VBA code examples - MacrosInExcel.com
Unhide All Worksheets Using Macros In Excel
Unhide All Worksheets Using Macros In Excel
How to Autofit Columns Using Macros in Excel
How to Autofit Columns Using Macros in Excel
Automating Excel Reports In 2023
Automating Excel Reports In 2023
1 Minute Excel Magic! [Video] in 2025 _ Microsoft excel tutorial
1 Minute Excel Magic! [Video] in 2025 _ Microsoft excel tutorial

4. You'll see a new module added to the Project Explorer. This is where you can write or record your macros.

Creating an Auto-Run Macro

Now that you're familiar with the basics of macros and the Personal Macro Workbook, let's create an auto-run macro.

For this example, let's create a simple macro that displays a message box saying "Hello, World!" when Excel opens.

Recording a Macro

You can record a macro to automate a series of actions. Here's how to record a simple "Hello, World!" message box:

1. In the VBA window, click on the 'Developer' tab in the Ribbon.

2. In the 'Code' group, click on 'Record Macro'.

3. In the 'Store macro in' dropdown, select 'Personal Macro Workbook'.

4. Enter a name for your macro (e.g., 'AutoRunMacro') and click 'OK'.

5. Now, go back to your Excel worksheet and type ' MsgBox "Hello, World!" '.

6. Press 'Enter' to display the message box, then click 'Stop Recording' in the 'Code' group.

Making the Macro Auto-Run

Now that you've recorded your macro, you need to make it auto-run when Excel opens. Here's how:

1. In the VBA window, go to 'Tools' > 'Options'.

2. In the 'Editor' tab, scroll down to the 'General' section.

3. In the 'At startup' field, type 'AutoRunMacro'.

4. Click 'OK' to close the Options dialog box.

Now, every time you open Excel, it will automatically run the 'AutoRunMacro' macro, displaying the "Hello, World!" message box.

Managing Startup Options

You can manage Excel's startup options to add or remove auto-run macros. Here's how:

1. In the VBA window, go to 'Tools' > 'Startup'.

2. In the 'Startup' dialog box, you'll see a list of workbooks that Excel will open automatically when it starts.

3. To add a workbook, click on 'Browse' and select the workbook you want to open automatically.

4. To remove a workbook, select it in the list and click 'Remove'.

5. Click 'OK' to close the dialog box.

Adding a Workbook to Startup Options

You can also add a workbook to Excel's startup options manually:

1. Open the workbook you want to open automatically.

2. Go to 'File' > 'Options' > 'Add-Ins'.

3. In the 'Add-Ins' dialog box, select 'Excel Add-ins' in the 'Manage' dropdown and click 'Go...'.

4. In the 'Add-Ins' dialog box, check the box next to 'Workbook' and click 'OK'.

5. Click 'OK' again to close the 'Options' dialog box.

Now, every time you open Excel, it will open the workbook you specified automatically.

And there you have it! You now know how to create an auto-run macro in Excel and manage its startup options. This can save you a lot of time and effort, making your work more efficient. So go ahead, automate those repetitive tasks and watch your productivity soar!