'Private Sub Resultat_Change()
' Me.Hide
'End Sub
Private Sub UserForm_Deactivate()
If notIsDate(Me.Resultat.Value) Then
Me.Resultat.Value = CDate(Sheets("Feuil1").Range("A1").Value)
End If
End Sub
Private Sub UserForm_Initialize()
Dim i As Integer
For i = 2020 To 2030
Me.ComboBox1.AddItem i
Next
For i = 1 To 12
Me.ComboBox2.AddItem Format(DateSerial(2020, i, 1), "mmmm")
Next
For i = 1 To Me.Controls.Count - 1
If Left(Me.Controls(i).Name, 13) = "CommandButton" Then Me.Controls(i).Caption = ""
Next
If IsDate(Sheets("Feuil1").Range("A1").Value) Then
Me.ComboBox1.Value = Year(Sheets("Feuil1").Range("A1").Value)
Me.ComboBox2.ListIndex = Month(Sheets("Feuil1").Range("A1").Value) - 1
End If
End Sub
Sub Reponse(monjour)
On Error Resume Next
calendar1.Resultat.Value = CDate(DateSerial(Me.ComboBox1.Value, Me.ComboBox2.ListIndex + 1, monjour))
End Sub