Sub CommandBarreCréerAvecBoutonEtMenu()
Dim LaBarre As CommandBar
Dim LeBouton
Dim MonMenu
Set LaBarre = Application.CommandBars.Add
With LaBarre
.Name = "Barredonnée"
.Position = msoBarFloating
Set MonControl = CommandBars("Barredonnée").Controls _
.Add(Type:=msoControlButton, ID:=280)
With MonControl
.Style = msoButtonIconAndCaption
.Caption = "Ajouter une donnée"
.OnAction = "Macro1"
End With
Set MonControl = CommandBars("Barredonnée").Controls _
.Add(Type:=msoControlButton, ID:=280)
With MonControl
.Style = msoButtonIconAndCaption
.Caption = "Modifier une donnée"
.OnAction = "Macro2"
End With
Application.CommandBars("Barredonnée").Visible = True
End With
End Sub