Hi All,
I have the following code. The search works well but I would like it to work as a partial search then if several matches display a list box with each match which I can then select. I have no clue how to do this. I have looked around and not seen anything particular that I could use. This is all incorporated within a userform.
Thank you in advance for your consideration and help.
regards
Ged
I have the following code. The search works well but I would like it to work as a partial search then if several matches display a list box with each match which I can then select. I have no clue how to do this. I have looked around and not seen anything particular that I could use. This is all incorporated within a userform.
VBA Code:
Private Sub CommandButton2_Click()
Dim Firstname As String
Firstname = Trim(txtFirstname.Text)
Lastrow = Worksheets("Portal").Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To Lastrow
If LCase(Worksheets("Portal").Cells(i, 2).Value) = LCase(Firstname) Then
txtFirstname.Text = Worksheets("Portal").Cells(i, 2).Value
TxtSurname.Text = Worksheets("Portal").Cells(i, 3).Value
TxtDOB.Text = Worksheets("Portal").Cells(i, 5).Value
Gender.Text = Worksheets("Portal").Cells(i, 4).Value
Age.Text = Worksheets("Portal").Cells(i, 6).Value
MemberSince.Text = Worksheets("Portal").Cells(i, 7).Value
Years.Text = Worksheets("Portal").Cells(i, 8).Value
Status.Text = Worksheets("Portal").Cells(i, 9).Value
Membership.Text = Worksheets("Portal").Cells(i, 1).Value
FEESpaid.Text = Worksheets("Portal").Cells(i, 11).Value
PaidDate.Text = Worksheets("Portal").Cells(i, 12).Value
FeesDue.Text = Worksheets("Portal").Cells(i, 13).Value
End If
Next
End Sub
Thank you in advance for your consideration and help.
regards
Ged