Bonjour et merci d’avance pour ce forum
Je voudrais copier Range("G10:K10") et le coller (complété le tableau) jusqu'à la dernière cellule de la colonne M.
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
23
24
25 Sub Fiche_sommer_doublons_BDD() Set d1 = CreateObject("Scripting.Dictionary") A = Range("D10:F" & [D65000].End(xlUp).Row) j = 0 For i = LBound(A) To UBound(A) If Not d1.exists(A(i, 1)) Then j = j + 1: d1(A(i, 1)) = j Next i Dim b(): ReDim b(1 To d1.Count, 1 To UBound(A, 2)) For Ligne = LBound(A) To UBound(A) p = d1(A(Ligne, 1)) b(p, 2) = b(p, 2) + A(Ligne, 2) b(p, 1) = A(Ligne, 1) Next Ligne [L10].Resize(UBound(b), UBound(b, 2)) = b Range("G10") = ActiveSheet.Name Range("G10:K10").Select Selection.Copy 'Compléter le tableau jusqu'à la dernier cellule de la colonne M End Sub
Merci encore
Partager