I'm trying to write some VBA code that returns the cell address that a VLOOKUP function references.
(Example: You have the letters A and B in A1 and A2. Then the numbers 1 and 2 in B1 and B2. Then VLOOKUP("B",A1:B2,2,0) would return the number 2. And with my code, I'd like to be able to return the cell address "B2", where the number 2 is located.)
I tried using the Evaluate method, but it seems to just be returning the value that the VLOOKUP finds, rather than the cell address.
Anyone got any ideas?
Thanks.
(Example: You have the letters A and B in A1 and A2. Then the numbers 1 and 2 in B1 and B2. Then VLOOKUP("B",A1:B2,2,0) would return the number 2. And with my code, I'd like to be able to return the cell address "B2", where the number 2 is located.)
I tried using the Evaluate method, but it seems to just be returning the value that the VLOOKUP finds, rather than the cell address.
Anyone got any ideas?
Thanks.