this is the code i used, the line that is cousing the trouble is "Text2= ...."
Private Sub CommandButton2_Click()
Dim qstring As String, q2string As String, Text2 As String
Sheets("TOP Teams").Select
Date001:
Range("IU655").Select
frmCalendar.Show ' i found this calendar macro somewhere else, and found it rather usefull
Qwerty = ActiveCell.Value
qstring = Qwerty
Range("IU654").Select
ActiveCell.Formula = "=Today()"
Qwerty2 = ActiveCell.Value
q2string = Qwerty2
If Qwerty - Qwerty2 >= 1 Then
QZX = MsgBox("De gekozen Datum " + qstring + " is in de toekomst. Het is vandaag " + q2string + ", kies en andere datum", vbOKOnly, "DatumSelectie")
GoTo Date001:
End If
Date002:
Range("IV655").Select
frmCalendar.Show ' i found this calendar macro somewhere else, and found it rather usefull
Qwerty3 = ActiveCell.Value
q3string = Qwerty3
Range("IV654").Select
ActiveCell.Formula = "=Today()"
Qwerty4 = ActiveCell.Value
q4string = Qwerty4
If Qwerty3 - Qwerty4 >= 1 Then
QZX = MsgBox("De gekozen Datum " + q3string + " is in de toekomst. Het is vandaag " + q4string + ", kies en andere datum", vbOKOnly, "DatumSelectie")
GoTo Date002:
End If
If Qwerty3 - Qwerty < 1 Then
QZX2 = MsgBox("De gekozen Datum " + q3string + " is eerder dan de begindatum " + qstring + ", kies en andere datum", vbOKOnly, "DatumSelectie")
GoTo Date002:
Else
Range("IT654").Select
ActiveCell.FormulaR1C1 = "=YEAR(R[1]C[1])"
Jaar = ActiveCell.Value
Range("IT655").Select
ActiveCell.FormulaR1C1 = "=MONTH(R[0]C[1])"
Maand = ActiveCell.Value
Text2 = "Haal nu met MRS de Moves binnen, en sla deze op als X:\Departments_M_Z\TPD\METL\Teams\data\" + Jaar + "\moves\" + Maand + "\Selectie.xls"
Title2 = "Selectie Bevestiging"
MsgBox prompt:=Text2, Buttons:=vbOKOnly, Title:=Title2
End If
End Sub