Bonjour à tous,
Effectivement Rag02700, tu as vu juste > si l'on passe par le code, on est limité à 254 caractères.
Mais si l'on pointe sur une plage, tout fonctionne bien.
Je suggère donc de masquer la colonne H et de tester ce code, lequel compose dans la colonne H la liste dynamique au gré des choix.
Sub Liste_selon_couleur(Couleur As Byte, Head_col As String)
Dim plage, Plage_SM As Range, Cellule As Range
Dim i, D_Ligne_liste As Byte
Dim Ws As Worksheet
Set Ws = Worksheets("OSCAR")
i = 1
Do Until Sheets("Liste").Cells(1, i).Value = Head_col
i = i + 1
Loop
D_Ligne_liste = Sheets("Liste").Cells(1, i).End(xlDown).Row
With Worksheets("Liste")
Set plage = .Range(.Cells(2, i), .Cells(D_Ligne_liste, i))
End With
Ws.Range("H5:H" & Cells(Rows.Count, "H").End(xlUp).Row).ClearContents ' vider la plage au préalable
i = 0
For Each Cellule In plage
If Cellule.Interior.ColorIndex = Couleur Then i = i + 1: Ws.Cells(i + 5, "H") = Cellule.Value
Next Cellule
With ActiveCell.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=H6:H" & i + 5
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
ric