Bonsoir à tous,
J'ai quelques difficultés de compréhension sur une macro que j'applique un peu "bêtement" dans mes tableaux, serait-il possible que l'un(e) d'entre vous me détaille chaque étape ?
Mille fois merci !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 Sub SousTotal3() a = Range("A2:B" & [a65000].End(xlUp).Row) Dim b(): ReDim b(1 To UBound(a), 1 To 2) i = 1: j = 0 Do While i <= UBound(a) j = j + 1: b(j, 1) = a(i, 1) Do While a(i, 1) = b(j, 1) b(j, 2) = b(j, 2) + a(i, 2) i = i + 1: If i > UBound(a) Then Exit Do Loop Loop [E2].Resize(UBound(b), UBound(b, 2)) = b End Sub
Partager