Bonjour,
voila j'ai fait un macro qui calcule la moyenne mobile d'une série mais à un certain moment ca donne des 0.
est ce quelqu'un peut m'aider?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 Sub somme() Dim a, c, moy As Variant Dim d, e As Variant Range("B1").Value = "moyenne_mobile" d = 0 For e = 2 To Cells(1, 7) + 1 d = d + Cells(e, 1) Selection.NumberFormat = "0.00" Next Cells(2, 2) = d / Cells(1, 7) c = 0 'cells(1,7) =période For c = 1 To 10 moy = 0 For a = c * Cells(1, 7) + c To (c + 1) * Cells(1, 7) + c - 1 moy = moy + Cells(a, 1) Next Cells(c + 2, 2) = moy / Cells(1, 7) Selection.NumberFormat = "0.00" Next End Sub
Partager