For starters.
Private Sub cmdSearch_Click()
Dim wRow
If txtname.Text = "" Then
MsgBox "Enter the name in the name block that you want to search": Exit Sub
End If
With ActiveSheet
wRow = Application.Match(txtname.Text, .Columns(1), 0)
If Not IsError(wRow) Then
txtname.Text = .Cells(wRow, 1)
txtposition.Text = .Cells(wRow, 2)
txtassigned.Text = .Cells(wRow, 3)
cmbsection.Text = .Cells(wRow, 4)
txtdate.Text = .Cells(wRow, 5)
txtjoint.Text = .Cells(wRow, 7)
txtDAS.Text = .Cells(wRow, 8)
txtDEROS.Text = .Cells(wRow, 9)
txtDOR.Text = .Cells(wRow, 10)
txtTAFMSD.Text = .Cells(wRow, 11)
txtDOS.Text = .Cells(wRow, 12)
txtPAC.Text = .Cells(wRow, 13)
ComboTSC.Text = .Cells(wRow, 14)
txtTSC.Text = .Cells(wRow, 15)
txtAEF.Text = .Cells(wRow, 16)
txtPCC.Text = .Cells(wRow, 17)
txtcourses.Text = .Cells(wRow, 18)
txtseven.Text = .Cells(wRow, 19)
txtcle.Text = .Cells(wRow, 20)
txtnote.Text = .Cells(wRow, 21)
Else
MsgBox "Name not found"
End If
End With
End Sub
Bookmarks