Ok, so i got this code of of excelvbamacro.com and it works perfectly fine in searching for something...but i'm having one issue. So say i try to search for "4.2" .. it will find 4.2, it will also find it under "44.2"
Basically i wanted to see if anybody knows how to convert this code to find only exactly what you are searching for in the cell. Thanks for the help guys!
Private Function pFindRowPos(sText As Variant, _
Optional SearchDirection As XlSearchDirection = xlNext, _
Optional SearchOrder As XlSearchOrder = xlByRows) As Long
Dim lResult As Long, oRg As Range
Set oRg = Cells.Find(What:=sText, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=SearchOrder, _
SearchDirection:=SearchDirection, _
MatchCase:=False, SearchFormat:=False)
If Not oRg Is Nothing Then lResult = oRg.Row
pFindRowPos = lResult
Set oRg = Nothing
End Function
Bookmarks