Hi Guys, where am i going wrong.
All i want to do is loop until there is a match. I promt user to enter a date between 2 dates. If there is no match i want the user to keep trying until the correct date is input else if they press cancel then Exit Sub
This is what i have so far
Set Rng = Sheets("Data").Range("B4:B" & LastWsRow)
Set Matchdate = Rng.Find(UserForm1.MonthView1.Value)
If Not Matchdate Is Nothing Then
Matchnum = Matchdate.Row
Else
Do
MsgBox "Enter date between " & Sheets("List").Cells(4, "B") & " - " & Sheets ("List").Cells(LastWsRow, "B"), vbRetryCancel, "ALERT"
Loop Until Matchdate = Rng.Find(UserForm1.MonthView1.Value)
End If
Matchnum = Matchdate.Row
Thank You
All i want to do is loop until there is a match. I promt user to enter a date between 2 dates. If there is no match i want the user to keep trying until the correct date is input else if they press cancel then Exit Sub
This is what i have so far
Set Rng = Sheets("Data").Range("B4:B" & LastWsRow)
Set Matchdate = Rng.Find(UserForm1.MonthView1.Value)
If Not Matchdate Is Nothing Then
Matchnum = Matchdate.Row
Else
Do
MsgBox "Enter date between " & Sheets("List").Cells(4, "B") & " - " & Sheets ("List").Cells(LastWsRow, "B"), vbRetryCancel, "ALERT"
Loop Until Matchdate = Rng.Find(UserForm1.MonthView1.Value)
End If
Matchnum = Matchdate.Row
Thank You