Hi All,
Below code helps find the exact match from the sheet2.
I need help with showing the partial matches as I type in the search box. for example, the item in the sheet 2 is Department ID, as I start typing the keyword "Dep" it starts showing me all the possible matches start with "Depa" which could be Department, Department Name, Department ID, etc. until I finish typing the Department ID to be the exact item that I am looking for.
Code
Private Sub CommandButton1_Click()
Dim r As Excel.Range
Set r = Sheets("Sheet2").Range("B:B").Find(What:=Textbox1.Text, LookAt:=xlWhole, MatchCase:=False)
If r Is Nothing Then
MsgBox "Not found...", vbExclamation
Else
TextBox2.Text = Sheets("Sheet2").Range("A" & r.Row).Value
TextBox3.Text = Sheets("Sheet2").Range("B" & r.Row).Value
TextBox4.Text = Sheets("Sheet2").Range("D" & r.Row).Value
TextBox5.Text = Sheets("Sheet2").Range("E" & r.Row).Value
TextBox6.Text = Sheets("Sheet2").Range("C" & r.Row).Value)
End If
End Sub
Display More
I would appreciate your help here.
Thanks.