Use the Find Method for a text search.
Private Sub SearchCB_Click()
Dim Res As Long
Dim Found As Range
Set Found = Sheets("RI PN Info").Range("A:A").Find(What:=PartNoTB.Value, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Found Is Nothing Then
Res = Found.Row
SDescriptionTB.Value = Sheets("RI PN Info").Range("C" & Res).Value
LDescriptionTB.Value = Sheets("RI PN Info").Range("D" & Res).Value
CustomerTB.Value = Sheets("RI PN Info").Range("E" & Res).Value
RevTB.Value = Sheets("RI PN Info").Range("F" & Res).Value
RICodeTB.Value = Sheets("RI PN Info").Range("G" & Res).Value
NOTE: If the user types in an asterisk (*) in the textbox, that is considered a wild card and will match any characters.
Bookmarks