Hi,
I have some problem with Excel LookUp.
I need to find address of the cell where the ID is located.
Example:
ID:
21999
21988
219
In this case how can I find the address of the cell where ID 219. If I use the activity LookUp it gives me the address of the cell where the ID is 21999. I thought about using Regex, but I don’t know how to use Regex with LookUp.
I find solution to my question. Maybe this will help someone.
I used this VBA code to get range:
Public Function FindRange(Value As String, MyRange As String) As String
Dim ra As Range
With ActiveSheet.Range(MyRange)
Set ra = .Find(What:=Value, LookIn:=xlValues, LookAt:=xlWhole)
If ra Is Nothing Then
FindRange = “Not Found”
Else
FindRange = Replace(ra.Address, “$”, “”)
End If
End With
End Function