I have a userform with 2 date pickers, The below code activates a message box if the date in dTpicker2 is greater than 6 days from DTpicker1, this works fine.
I cannot get this macro to change the date via DTpicker 2 if the date is less than the 6 days, what do I have to add to make this happen, at the moment it will not change any date on sheet1 that is less than the 7 days.
Private Sub DTpicker2_change()
If DTPicker2 > DTPicker1.Value + 6 Then
MSG1 = MsgBox("You Have Selected A Date Greater Than 7 Days, Do You Wish To Continue", vbYesNo, "Moving")
If MSG1 = vbYes Then
Sheets("Sheet1").Range("B1") = DTPicker2.Value
Else
If MSG1 = vbNo Then
Exit Sub
End If
End If
End If
End Sub
Thank for any assistance
Bookmarks