Run a Macro from Another Macro in Excel

Add to Favorites
Author:

I will show you how to run a macro from another macro in Excel.  This means that you can run any macro when you need to from a completely separate macro.

This is actually very simple!

Use Call in VBA.

Here is the macro we want to call or run using another macro:

Sub Macro_2()

 

MsgBox "Hi!"

 

End Sub

And here is the macro that will call or run this macro:

Sub Macro_1()

 

'call the second macro

Call Macro_2

 

End Sub

It is as simple as that.  Put Call in front of the name of the macro that you want to run.

Here is a screenshot of these two macros in Excel:

Download the spreadsheet for this tutorial, from below or the side-bar of this page, and you can test out these macros.

 


Downloadable Files: Excel File

Question? Ask it in our Excel Forum


Our Excel Courses

  • Skill Level: All Levels
  • |
  • 5 hours+

How to make a fully featured professional form in Excel that is unbreakable. This includes how to use the form to store, view, edit, and delete data from a data storage worksheet.

  • Skill Level: All Levels
  • |
  • 2 hours

Send Emails from Excel using VBA and Macros. This course starts from the Basics and builds up to more advanced examples with attaching workbooks, worksheets, PDF's, automatically sending emails, including a signature, error handling, increasing speed, and more.

Similar Content on TeachExcel
Use Macros with UserForms
Tutorial: This tutorial explains how macros interact with UserForms. This includes an explanation of...
Automatically Run a Macro so Many Seconds, Minutes, or Hours After an Excel Workbook has been Opened
Macro: Run a macro after a certain amount of time has passed since the Excel workbook was ope...
Run a Macro when a User Does Something in the Worksheet in Excel
Tutorial: How to run a macro when a user does something in the worksheet, everything from selecting ...
Stop a Macro from Running in Excel
Tutorial: How to stop a macro from running after it has started. This method uses the keyboard an...
Run a Macro When a Specific Cell Changes in Excel
Tutorial: Run a macro in Excel when a specific cell is changed; this also covers when a cell within...
Run a Macro When you Click a Button in Excel
Tutorial: Make a macro run when you click a button in the worksheet in Excel. This allows you to cr...
Tutorial Details
Downloadable Files: Excel File
Similar Content
Use Macros with UserForms
Tutorial: This tutorial explains how macros interact with UserForms. This includes an explanation of...
Automatically Run a Macro so Many Seconds, Minutes, or Hours After an Excel Workbook has been Opened
Macro: Run a macro after a certain amount of time has passed since the Excel workbook was ope...
Run a Macro when a User Does Something in the Worksheet in Excel
Tutorial: How to run a macro when a user does something in the worksheet, everything from selecting ...
Excel Forum