03856me
Active Member
- Joined
- Apr 4, 2008
- Messages
- 297
On my user form, I would like the input limited to between TODAY and 60 days earlier.
I know how to write a formula for this on a worksheet, but not in a Userform.
Thank you for your help.
I know how to write a formula for this on a worksheet, but not in a Userform.
Thank you for your help.
VBA Code:
Private Sub txt_date_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'If txt_date = vbNullString Then Exit Sub
If IsDate(txt_date) Then
txt_date = Format(txt_date, "Short Date")
Else
MsgBox "Not a valid date, try again!"
Cancel = True
txt_date.Value = ""
frm_dataInput.txt_date.SetFocus
End If
End Sub