Bonjour,
j'ai fait while dans while donc normal je devrais avoir un truc de ce genre.
Mais seule la premère branche est appliqué. svp pouvez me dire où j'ai fait erreur.
Dim NbLignes As Integer
NbLignes = Sheets("BD").UsedRange.Rows.Count
With Application.CommandBars("Cell").Controls.Add(msoControlPopup)
.Caption = "Configuration API" 'le nom de la commande
.BeginGroup = True 'ligne facultative si elle est précisée alors
' With .Controls.Add(msoControlPopup)
' .Caption = Sheets("BD").Range("B3").Value 'le nom de la commande
While i <= NbLignes + 1
With .Controls.Add(msoControlPopup)
.Caption = Sheets("BD").Range("B" & i).Value
.BeginGroup = True
'.OnAction = "dupliquerlignes" 'appel de la macro
' Le numéro est augmenté de 1 à chaque boucle
While j <= NbLignes + 1
With .Controls.Add(msoControlPopup)
.Caption = Sheets("BD").Range("C" & j).Value
'.BeginGroup = True
While k <= NbLignes + 1
With .Controls.Add(msoControlPopup)
.Caption = Sheets("BD").Range("D" & k).Value
While l <= NbLignes + 1
With .Controls.Add(msoControlButton)
.Caption = Sheets("BD").Range("E" & l).Value
l = l + 1
End With
Wend
k = k + 1
End With
Wend
j = j + 1
End With
Wend
i = i + 1
End With
Wend
End With