Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings, I have a VBA that works great where if the three letter code "ACV" is provided it will search over 10K rows for the appropriate response. However, on occasion I may be given a 7 digit character "BGR-ACV". I am hoping someone can let me know how I can insert a rule where it will search only the last three characters to the right. My current VBA is:
I think need something like
but I don't know how or where to slip something like that in. Thank you,
VBA Code:
Private Sub VLOOK_UP()
Dim i As Integer
For i = 1 To Split(Worksheets("72 Hr").UsedRange.Address, "$")(4)
Worksheets("72 Hr").Cells(i, 12).Value = _
Application.WorksheetFunction.VLookup(Worksheets("72 Hr").Cells(i, 8).Value, _
Worksheets("3 LTR").Range("A:B"), 2, 1)
Next i
End Sub
I think need something like
Excel Formula:
VLOOKUP(RIGHT(A2,3)