Bonjour
si je tape une nouvelle sous-catégorie en cochant optionbutton j'ajoute directement la nouvelle sous-catégorie dans la colonne correspondante suivant le listing des catégories de combobox1 dans le tableau
C'est en cliquant sur le bouton ajouter que vous voulez faire cela ?
Sinon modifiez ces deux macros dans l'usf :
Private Sub Userform_Initialize()
With Sheets("Feuil2")
ComboBox1.List = .Range("A2:A" & .Range("A65536").End(xlUp).Row).Value
End With
End Sub
et
Private Sub ComboBox1_AfterUpdate()
Dim Ligne As Long
Dim colonne As Byte, dcol As Byte
ComboBox2.Clear
With Sheets("Feuil2")
dcol = .Cells(1, .Columns.Count).End(xlToLeft).Column
colonne = .Range(.Cells(1, 1), .Cells(1, dcol)).Find(ComboBox1.Value, LookIn:=xlValues, lookat:=xlWhole).Column
Ligne = .Cells(.Rows.Count, colonne).End(xlUp).Row
ComboBox2.List = .Range(.Cells(2, colonne), .Cells(Ligne, colonne)).Value
End With
End Sub
Cordialement