Running macros with macros

scanavan

New Member
Joined
Jul 27, 2007
Messages
10
I am looking to for the VB script that will allow me to operate a second macro within the current macro that is being executed.

Can anyone help?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Like this?

Code:
Sub macro1()
'code
Call Macro2
'more code
End Sub


Sub Macro2()
'code
End Sub
 
Upvote 0
You can call the second macro by simply using it’s name:
Code:
Sub Macro1()
MsgBox "This is Macro1"
Macro2
End Sub

Sub Macro2()
MsgBox "This is Macro2"
End Sub
 
Upvote 0
Hi,

Why not just call the other macro , e.g.
Code:
Sub Macro1()

Call Macro2 (1,2 3)

End Sub

Sub Macro2(byVal A as Integer,byVal B as Integer, ByVal C as Integer)
.....
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,478
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top