Re : création d'une liste
Re Paritec,
Je n'arrive pas à faire fonctionner la macro couleur sur mon document, je ne comprend pas trop car quand j'adapte celui que tu m'as renvoyé de la même manière que le mien celui-ci fonctionne bien.
Voici ma macro :
Option Explicit
Option Base 1
Sub dispatcher()
Call copypast 'j'ai du rajouter ceci pour simplifier
'le processus mais avec ou sans cela ne change rien
Dim i&, fin&, bb As Variant, a&, y&, fin1&, x&
Feuil3.Range("A2:C100").Clear
fin = Feuil2.Range("F" & Rows.Count).End(xlUp).Row
With Feuil2
y = 1: x = 2
1 For i = 1 To fin
If .Cells(i, 5) = y Then .Cells(i, 6).Copy Feuil3.Cells(x, y): x = x + 1
If y = 7 Then Exit Sub
If i = fin Then y = y + 1: x = 2: GoTo 1
Next i
End With
2 Call couleur
End Sub
Sub couleur() 'ma Feuil3 correspond à la Feuil2 sur le document que tu me renvois
Dim cl As Range, TempCount&, ColorIndex&, fin&, plage As Range, i&
fin = Cells.Find("*", , xlValues, , 1, 2, 0).Row
Set plage = Feuil3.Range("A2:C" & fin)
For i = 2 To 5
ColorIndex = Feuil3.Cells(i, 5).Interior.ColorIndex
If ColorIndex = -4142 Then GoTo 1
TempCount = 0
For Each cl In plage
If cl.Interior.ColorIndex = ColorIndex Then TempCount = TempCount + 1
Next cl
Set cl = Nothing
Feuil3.Cells(i, 6) = TempCount
1 Next i
End Sub