Hi everyone,
I have a userform that has 2 textboxes to add data to a worksheet, this all works fine although i would like it to also search a worksheet called "Members" for a matching value entered into my first textbox called "txtMemFirst" if no matching name is found then it needs to show a msgbox "Member not found!"
If a matching name is found then continue...
Please see code below so far:
I have a userform that has 2 textboxes to add data to a worksheet, this all works fine although i would like it to also search a worksheet called "Members" for a matching value entered into my first textbox called "txtMemFirst" if no matching name is found then it needs to show a msgbox "Member not found!"
If a matching name is found then continue...
Please see code below so far:
Code:
Private Sub CmbAdd_Click()
Dim rw As Long 'next available row
With Sheets("Fees Paid")
.ScreenUpdating = False
.EnableEvents = False
'get the next avialable row in Sheet1
rw = .Range("B" & .Rows.Count).End(xlUp).Row + 1
'put the text box values in this row
.Range("B" & rw).Value = txtMemFirst.Value
.Range("I" & rw).Value = txtAmountPaid.Value
.EnableEvents = True
.ScreenUpdating = True
End With
'================================
'Clear the text boxes
'================================
txtMemFirst.Value = ""
txtAmountPaid.Value = ""
End Sub