asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,236
- Office Version
- 2013
- Platform
- Windows
Code:
Dim ws As Worksheet, rngFind As Range
Set ws = ThisWorkbook.Sheets("staff")
Set rngFind = ws.Range("i:i").Find(what:=Me.TextBox2.Value, MatchCase:=True)
If Not rngFind Is Nothing Then
Me.TextBox20.Value = rngFind.Offset(0, 1).Value
Me.TextBox21.Value = rngFind.Offset(0, 2).Value
Else
Me.TextBox20.Value = "Not Found!"
TextBox21 = ("")
End If
Could someone help me to improve that given code above?
Its simply find column B value by entering the column A value into the TextBox2.Everything fine with that if the value is single like a name or ID number.....
My question is how can i make it more functional , like if the name is with 3 names and the user want to seach by second name or 3th?
If the name on column B ; Roberto Carlos Gonzales and if i type the Carlos name on TextBox2 then whole name will be find.
Hope its clear!
Many Thanks.