I want to modify this date picker so any date ahead of today’s date cannot be selected. Can you help?
Public Sub PickDate()
Dim PickedDate As Date
If ActiveCell.Row > 3 Then
If obPosUpLeft.Value Then 'radiobutton in sheet 1: "UpperLeft" selected
PickedDate = frmWMDatePicker.GetDate(, , Application.ActiveWindow.Left, ActiveWindow.Top + CommandBars("Ribbon").Height)
Else 'radiobutton in sheet 1: "Centered" selected
PickedDate = frmWMDatePicker.GetDate()
End If
If PickedDate > 0 Then ActiveCell = PickedDate
End If
End Sub
Private Sub btPickDate_Click()
Dim posLeft As Long
Dim posTop As Long
Dim PickedDate As Date
If obPosUpLeft.Value Then 'radiobutton in sheet 1: "UpperLeft" selected
posLeft = Application.ActiveWindow.Left
posTop = ActiveWindow.Top + CommandBars("Ribbon").Height
End If
PickedDate = frmWMDatePicker.GetDate(Range("StartDate"), Range("StartDate").Interior.Color, posLeft, posTop)
If PickedDate > 0 Then Range("ResultDate") = PickedDate
End Sub
Private Sub btTestUserForm_Click()
TestForm.Show
End Sub
Private Sub btDirectCall_Click()
frmWMDatePicker.Show
End Sub