Public AnRes As Long
Sub Calc()
Dim I As Long, Col As Long, J As Long, Plage As Range
' Application.EnableEvents = False
With Sheets("BDD")
'enregistrement des données
Col = Application.Match(AnRes, .[1:1], 0)
With Sheets("CALENDRIER")
Set Plage = .Range("B10", .Cells(.Rows.Count, 2).End(xlUp))
End With
J = 0
For I = 1 To 342 Step 31
J = J + 2
.Cells(1, Col).Offset(I).Resize(31).Value = Plage.Offset(, J).Value
Next I
'Import de l'année choisie
Col = Application.Match([CALENDRIER!C4], .[1:1], 0)
J = 0
For I = 1 To 342 Step 31
J = J + 2
Plage.Offset(, J).Value = .Cells(1, Col).Offset(I).Resize(31).Value
Next I
End With
AnRes = [CALENDRIER!C4]
' Application.EnableEvents = True
End Sub