Sub hankey()
'tableau pour mettre les codes
Dim tab_code(200) As Double
tmp_ligne = 0
For Each Feuille In Worksheets
cpt = cpt + 1
Next
'tab_code contient tous les codes de toutes les feuilles !!!
For z = 1 To cpt - 1
Sheets("feuil" & z).Select
For i = 2 To Range("A65536").End(xlUp).Row
code = Cells(i, 1)
present = False
For h = LBound(tab_code) To UBound(tab_code)
If tab_code(h) = code Then
present = True
End If
Next h
If present = False Then
tab_code(tmp_ligne) = code
tmp_ligne = tmp_ligne + 1
End If
Next i
Next z
'dans un premier temps on remplis la colonne A avec tous les codes
j = 2
Sheets("Résumé").Select
For h = LBound(tab_code) To UBound(tab_code)
If tab_code(h) <> 0 Then
Cells(j, 1) = tab_code(h)
j = j + 1
End If
Next h
'ici on va remplir la feuille résumé avec les autres feuilles
c = 2
For y = 1 To cpt - 1
Sheets("feuil" & y).Select
For i = 2 To Range("A65536").End(xlUp).Row
Sheets("feuil" & y).Select
code = Cells(i, 1)
designation = Cells(i, 2)
montant = Cells(i, 3)
Sheets("Résumé").Select
For z = 2 To Range("A65536").End(xlUp).Row
If code = Cells(z, 1) Then
Cells(z, c) = designation
Cells(z, c + 1) = montant
End If
Next z
Next i
Cells(1, c) = "feuil" & y
c = c + 2
Next y
End Sub