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 30 31 32 33 34 35 36 37 38 39 40 41 42
| Sub TT()
Columns("a:c").Clear
debut = 2017
fin = debut + 5
d = DateSerial(debut, 1, 1)
lig = 1
While Year(d) < fin
jour = Format(d, "dddd")
If jour = "samedi" Or jour = "dimanche" Then
nbr = 1
Else
nbr = 3
End If
For I = 1 To nbr
lig = lig + 1
Cells(lig, 1) = d
Cells(lig, 3) = jour
If nbr = 1 Then
Else
Select Case I
Case 1
Cells(lig, 2) = "Matin"
Case 2
Cells(lig, 2) = "APRES MIDI"
Case 3
Cells(lig, 2) = "NUIT"
End Select
End If
Next
d = d + 1
Wend
End Sub |
Partager