Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a macro from within a macro

Status
Not open for further replies.

rendezvous

IS-IT--Management
Feb 27, 2003
5
CA
If I have 2 macros, TEST and TEST2, how can I call TEST2 from within the first macro TEST?

Sub TEST()
ActiveCell.FormulaR1C1 = "SAY HELLO"
Range("A2").Select
End Sub

Sub TEST2()
ActiveCell.FormulaR1C1 = "SAY GOODBYE"
Range("A3").Select
End Sub

thanks
 
Hi,
Code:
Sub TEST()
    ActiveCell.FormulaR1C1 = "SAY HELLO"
    Range("A2").Select
    Test2
End Sub
That simple :) Skip,
Skip@theofficeexperts.com
 
If your code is in, say, Module1 then is you type Module1. it'll display all the subs in Module1 then pick it.

so Module1.Test2
 
But you don't have to specify the module, unless it resolves an ambiguous macro name.
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top