1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Option Explicit
Private Function bissextile(madate As Date) As Boolean
bissextile = Day(DateSerial(Year(madate), 3, 0)) = 29
End Function
Private Sub CommandButton_Annuler_Click()
Unload Me
End Sub
Private Sub CommandButton_Ok_Click()
Dim sNum As String
sNum = Me.ComboBox1.Value
If Len(sNum) > 0 Then
MsgBox sNum
Else
MsgBox "Bad"
End If
End Sub
Private Sub UserForm_Initialize()
Dim i As Long
Dim NbSem As Long
If bissextile(Date) Then NbSem = 53 Else NbSem = 52
ComboBox1.Clear
For i = 1 To NbSem
ComboBox1.AddItem Format(i, "00")
Next i
End Sub |