retrieve row of vlookup result (vba)?

arongahagan

New Member
Joined
Dec 15, 2005
Messages
3
Hi;

In VBA, is there any way to access the row (or the cell address) of the vlookup result?

for example, i have:

Code:
dim v as double
v = application.vlookup(ein_index,table_array,column_index,false)

...to get the value of the cell. i already know the column_index, but what i need is the row (or address) of that cell...is this possible? any creative geniuses out there?

I'm running Excel 2003 on XP pro.

TIA,
AG
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hello, arongahagan
Welcome to the Board !!!!!

take a look at FIND
Code:
Sub test()
Dim c As Range
Dim R As Long

Set c = YourRange.Find(YourValue) 'add other arguments see helpfiles for FIND

If Not c Is Nothing Then R = c.Row
End Sub

kind regards,
Erik
 
Upvote 0
Yes, that would work nicely--except I need to be certain I'm getting the exact same cell that this vlookup formula is returning, in order to change its value if necessary...

thanks for the reply - any more ideas, i'm all ears!

AG
 
Upvote 0
I need to be certain I'm getting the exact same cell that this vlookup formula is returning
are there more instances of the value to find ?
if only one there wouldn't be a problem

so time to provide a little example ...

best regards,
Erik
 
Upvote 0
unfortunately, yes, there are multiple values (data scrubbing isn't fun at all!) Then again, I have validation earlier in the code to ensure i'm not looking at a duplicate value...so the FIND function will work, after all!

Thanks, Erik, and Merry Christmas!
AG
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

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