smiller0422
New Member
- Joined
- Sep 15, 2011
- Messages
- 3
I'm using the VLookup function in a macro. If a data element from sheet1 is found in sheet2's lookup range, I would like to save/store the cell's location from sheet2 in a variable.
[font=Verdana] [color=darkblue]Dim[/color] Rng [color=darkblue]As[/color] Range
[color=darkblue]Dim[/color] Rw [color=darkblue]As[/color] [color=darkblue]Long[/color]
[color=darkblue]Set[/color] Rng = Evaluate("index(sheet2!a1:a100,match(sheet1!b2,a1:a100,0))")
Rw = Rng.Row
[/font]