hi all
i have made a macro with a msgbox inside, i want it to make a msgbowx with only a "ok" button, the msgbox should only appear if the chosen date is in the future or is todays date.
If that is the case i need it to restart the date selection until the user choses a date in the past
the code below gives me an error and the line with the msgbox code is selected then, i dont know what i did wrong there
Private Sub CommandButton2_Click()
Sheets("Teams").Select
Date001:
Range("IV655").Select
frmCalendar.Show ' i found this calendar macro somewhere else, and found it rather usefull
Qwerty = ActiveCell.Value
Range("IV654").Select
ActiveCell.Formula = "=Today()"
Qwerty2 = ActiveCell.Value
If Qwerty - Qwerty2 >= 1 Then
QZX = MsgBox("The chosen date " + Qwerty + " is in the future. Today it is " + Qwerty2 + ", chose another date", vbOKOnly, "DateSelectie", , 1000)
GoTo Date001:
End If
End Sub
please me with this problem
i have made a macro with a msgbox inside, i want it to make a msgbowx with only a "ok" button, the msgbox should only appear if the chosen date is in the future or is todays date.
If that is the case i need it to restart the date selection until the user choses a date in the past
the code below gives me an error and the line with the msgbox code is selected then, i dont know what i did wrong there
Private Sub CommandButton2_Click()
Sheets("Teams").Select
Date001:
Range("IV655").Select
frmCalendar.Show ' i found this calendar macro somewhere else, and found it rather usefull
Qwerty = ActiveCell.Value
Range("IV654").Select
ActiveCell.Formula = "=Today()"
Qwerty2 = ActiveCell.Value
If Qwerty - Qwerty2 >= 1 Then
QZX = MsgBox("The chosen date " + Qwerty + " is in the future. Today it is " + Qwerty2 + ", chose another date", vbOKOnly, "DateSelectie", , 1000)
GoTo Date001:
End If
End Sub
please me with this problem