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
| Sub h()
Duree = Cells(5, 3).Value
PeriodeDepart = Cells(11, 3).Row
IndexPeriode = Cells(11, 3).Value
IndexMois = Cells(11, 4).Value
For i = 1 To Duree - 1
Cells(PeriodeDepart + i, 3) = Format(DateAdd("m", i, IndexPeriode), "mmmm-yy") 'incrémente ton mois
Cells(PeriodeDepart + i, 4) = IndexMois + i 'incrémente NB_Mensual
Cells(PeriodeDepart + i - 1, 5).Activate
Selection.Copy
Cells(PeriodeDepart + i, 5).Activate
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False 'copie formule
Cells(PeriodeDepart + i - 1, 6).Activate
Selection.Copy
Cells(PeriodeDepart + i, 6).Activate
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False 'copie formule
Cells(PeriodeDepart + i - 1, 7).Activate
Selection.Copy
Cells(PeriodeDepart + i, 7).Activate
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False 'copie formule
Next i
End Sub |
Partager