VBA & Macro Problems

How to Chain or Repeat Multiple VBA Macros in Excel

Steve KSteve K Nov 3, 2026 870 views

Question details

The user needs to execute several VBA macros in a specific sequence or run a single macro a specified number of times.

How to Chain or Repeat Multiple VBA Macros
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Automating complex spreadsheet workflows that require triggering multiple pre-existing macros in order, or looping a process automatically.
Observed behavior
The user is looking to create a master script to call other macro procedures sequentially or loop them iteratively.
Before you start

Ensure you have your individual macros written and tested independently. Save your workbook as a Macro-Enabled Workbook (.xlsm) to ensure your VBA scripts are preserved.

Solution 1Recommended

Run Multiple Macros Sequentially Using the Call Statement

Create a master macro that acts as a controller to trigger other macros in a specific order using the VBA 'Call' command.

The easiest way to chain macros is to create a new subroutine that contains a sequence of 'Call' statements. When this master macro is run, it executes each specified macro one by one.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.

2
Insert a Controlling Subroutine

In an existing module or a newly inserted module (Insert > Module), type 'Sub MasterMacro()' and press Enter.

3
Add Call Statements

Inside the subroutine, type 'Call' followed by the name of the first macro you want to run (e.g., 'Call Macro1'). On the next line, type 'Call Macro2', and continue for all required macros.

4
Run the Sequence

Close the VBA editor, press Alt + F8 to open the Macro dialog box, select 'MasterMacro', and click 'Run'.

Run Multiple Macros Sequentially Using the Call Statement
Best Practice: Using the 'Call' keyword makes your code much easier to read and maintain, clearly indicating that an external procedure is being executed.
Advanced VBA Support in WPS Office

Automate Tasks Seamlessly with WPS Spreadsheet

WPS Spreadsheet offers robust support for VBA and macros, allowing you to write, edit, chain, and execute scripts easily to streamline complex automation workflows.

  1. 1. Open Your Workbook: Launch WPS Office and open your .xlsm file containing the individual macros.
  2. 2. Access the VBA Editor: Go to the 'Developer' tab on the ribbon and click 'VBA Editor' to open the scripting environment.
  3. 3. Write the Master Script: Use standard VBA syntax, such as the 'Call' method or 'For...Next' loops, to build your sequence or repetition logic.
  4. 4. Execute the Workflow: Click 'Macros' in the Developer tab, choose your new master script, and click 'Run'.
Fully compatible with Microsoft Excel (.xlsm) macro-enabled file formats.Built-in Visual Basic Editor to write controlling macros, variables, and loops.Familiar Developer tab interface for intuitive macro management.Lightweight, fast, and feature-rich for everyday data processing tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Do I absolutely need to use the 'Call' keyword to run another macro?

While not strictly required (you can simply type the macro's name on a line by itself), using the 'Call' keyword is highly recommended. It makes your code more readable and explicitly shows that another subroutine is being executed.

Can I pass variables or arguments between chained macros?

Yes. If your receiving macro is designed to accept parameters (e.g., Sub Macro2(myVar As String)), you can pass variables from your master macro using the Call statement like this: Call Macro2(myVariable).

What happens if an error occurs in one of the chained macros?

By default, an error in any of the chained macros will halt the entire process and display a standard VBA error dialog. You can implement 'On Error GoTo' error-handling blocks in your master macro to manage these interruptions gracefully.

Why won't my master macro show up when I press Alt + F8?

If your macro is defined as a 'Private Sub' or requires parameters, it will not appear in the standard Macro dialog box. Ensure it is defined simply as 'Sub MasterMacro()' with no parameters inside the parentheses.