Sub init_menu()
Dim i As Integer, sm As Variant
On Error Resume Next
Application.CommandBars("Postes").Delete
On Error GoTo 0
Set cbar = Application.CommandBars.Add("Postes", msoBarPopup)
With cbar
For i = 1 To Range("postes").Cells.Count
Set sm = cbar.Controls.Add(msoControlButton, 1, , , True)
sm.Caption = Range("postes")(i) '& " " & "postes_lance(" & i & ")"
sm.Tag = "Saisie.postes_lance(" & i & ")"
sm.OnAction = "TestMacro"
Next i
End With
End Sub