OldManDemosthenes
New Member
- Joined
- Apr 19, 2011
- Messages
- 38
I have a macro (macro1) which sets up several variables. Is it possible to have macro2 call and use the variables setup in macro1?
So the Code for macro1 would look something like this
and macro2
The problem I am having is that Macro2 is not recognizing the dim variables (ARow and others) from Macro1
Thanks!
So the Code for macro1 would look something like this
Code:
Sub Macro1()
Dim ALocation As Range, ARow As Long
[INDENT]Set ALocation = Worksheets("Test").Range("A:B").Find("String")[/INDENT]
[INDENT][B]ARow[/B] = ALocation.Row[/INDENT]
End Sub
and macro2
Code:
Sub Macro2()
Call Macro1
Worksheets("Test").Range("C1") = Worksheets("Test").Cells([B]ARow[/B], 10).value
End Sub
The problem I am having is that Macro2 is not recognizing the dim variables (ARow and others) from Macro1
Thanks!
Last edited: