How to run multiple Excel macros in a worksheet
We have created two macros with the names FirstMacro() and SeconMacro() and will demonstrate how to run the multiple Excel macros:
- The FirstMacro() simply outputs a welcome message
- The SecondMacro() asks the user to enter a number. Once the number is entered the macro asks whether it should guess the number. On clicking on OK it outputs the correct number and finally says ‘Bye’.
- You can run these macros alone only
- Now we create a third macro call runmultiplemacros which calls the above two macros
- Click inside this macro and then click run to execute the first two macros
The training video demonstrates the process properly.
Macro code for reference:
Number = Application.InputBox(“Enter any number”)
MsgBox (“Do you want me to guess the number?”), vbDefaultButton1