I have the following code. It works perfectly if I type in the correct case sensitivity. Is there a way to make the search case insenitive? I would also like to either search for first name or surname. Do I need to separate macros or can it be done with one?
Thanks in advance to any and all who help
regards
Ged
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 = 2 To Lastrow
If Worksheets("Portal").Cells(i, 2).Value = Firstname Then
TxtSurname.Text = Worksheets("Portal").Cells(i, 3).Value
TxtDOB.Text = Worksheets("Portal").Cells(i, 4).Value
Gender.Text = Worksheets("Portal").Cells(i, 5).Value
Number.Text = Worksheets("Portal").Cells(i, 1).Value
Age.Text = Worksheets("Portal").Cells(i, 12).Value
MemberSince.Text = Worksheets("Portal").Cells(i, 8).Value
Years.Text = Worksheets("Portal").Cells(i, 13).Value
Status.Text = Worksheets("Portal").Cells(i, 14).Value
Membership.Text = Worksheets("Portal").Cells(i, 6).Value
FEESpaid.Text = Worksheets("Portal").Cells(i, 7).Value
PaidDate.Text = Worksheets("Portal").Cells(i, 9).Value
End If
Next
End Sub
Thanks in advance to any and all who help
regards
Ged