I have a vLookup routine that looks like this:
I'm able to find the value in Col1_Fnd, but I want to select the row that the value is in. For example, the lookup values are in A1:A26. If the value found (Col1_Fnd) is in A5, I want to be able to select this row.
Code:
Function Customer_vlookup(Table_Rng As Range, Return_Col As Long, Col1_Fnd, Col2_Fnd)
Dim rCheck As Range, bFound As Boolean, lLoop As Long
Dim rowSet As Range
On Error Resume Next
Set rCheck = Table_Rng.Columns(1).Cells(1, 1)
With WorksheetFunction
For lLoop = 1 To .CountIf(Table_Rng.Columns(1), Col1_Fnd)
Set rCheck = Table_Rng.Columns(1).Find(Col1_Fnd, rCheck, xlValues, xlWhole, xlNext, xlRows, False)
'
' I want to be able to select the row after item is found (Col1_Fnd)
'
exit for
Next lLoop
End with
I'm able to find the value in Col1_Fnd, but I want to select the row that the value is in. For example, the lookup values are in A1:A26. If the value found (Col1_Fnd) is in A5, I want to be able to select this row.
Last edited by a moderator: