Re le forum
Excuse-moi, Maguetlolo, j'avais oublié la deuxième partie de ta question
Pour le UserForm1
Private Sub ComboBox1_Change()
With ComboBox2
If ComboBox1.Value = "A" Then .RowSource = "Feuil1!E3:E8"
If ComboBox1.Value = "B" Then .RowSource = "Feuil1!F3:F8"
If ComboBox1.Value = "C" Then .RowSource = "Feuil1!G3:G8"
If ComboBox1.Value = "D" Then .RowSource = "Feuil1!H3:H8"
If ComboBox1.Value = "E" Then .RowSource = "Feuil1!I3:I8"
If ComboBox1.Value = "" Then .RowSource = ""
End With
End Sub
Private Sub CommandButton1_Click()
Cells(ComboBox2.ListIndex + 3, ComboBox1.ListIndex + 5) = ""
Range(Cells(3, ComboBox1.ListIndex + 5), Cells(25, ComboBox1.ListIndex + 5)) _
.Sort Key1:=Cells(3, ComboBox1.ListIndex + 5), Order1:=xlAscending
ComboBox1 = "": ComboBox2 = ""
End Sub
Et pour le UserForm2
Private Sub ComboBox1_Change()
TextBox1 = ""
End Sub
Private Sub CommandButton1_Click()
Cells(Cells(25, ComboBox1.ListIndex + 5).End(xlUp).Row + 1, ComboBox1.ListIndex + 5) = UCase(TextBox1.Value)
Range(Cells(3, ComboBox1.ListIndex + 5), Cells(25, ComboBox1.ListIndex + 5)) _
.Sort Key1:=Cells(3, ComboBox1.ListIndex + 5), Order1:=xlAscending
ComboBox1 = "": TextBox1 = ""
End Sub
Mytå
P.S. J'ai limité le code à la ligne 25, et fait un tri pour éviter les lignes vides.