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
| Sub Tablo()
Dim an%, nbj%, i%, c%, dateDébut As Date, dep As Range, mois, jour As Long
Dim pâques, Lundi_de_Pâques, Ascension, Pentecôte As Variant
Dim saisie, Jour_de_noël As Variant
Dim Longue, Large As Variant
Cells.Select
Selection.Delete Shift:=xlUp
saisie = Application.InputBox("Saisir l'année de début du tableau ? ", "Saisie de l'année de référence", 0, 500, 500, , , 1)
If Not IsNumeric(saisie) Then Exit Sub
If saisie = False Then MsgBox "Vous n'avez rien saisi"
dateDébut = "1/5/" & saisie 'Première date
Set dep = [A1] 'Coin supérieur gauche du calendrier.
nbj = DateSerial(Year(dateDébut) + 1, Month((dateDébut)), Day(dateDébut)) - dateDébut
Dim tabdate() As Variant
ReDim tabdate(nbj)
Dim iii As Long
For iii = LBound(tabdate, 1) To UBound(tabdate, 1)
tabdate = Range(dateDébut)
dateDébut = dateDébut + 1
Next
Sheets("Feuil1").Activate
Application.EnableEvents = False
With Sheets("Feuil1")
.Range("B5").Resize(UBound(tabdate, 1), UBound(tabdate, 2)) = tabdate
End With
Application.EnableEvents = True |
Partager