1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Sub Affiche_barre_popup()
CommandBars("MaBarrePopup").ShowPopup
End Sub
Sub Creation_barre_popup()
'déclaration des variables
Dim Cbar As CommandBar, Clist As CommandBarComboBox, x As Byte
'création de la barre de menu de type Popup
Set Cbar = CommandBars.Add(Name:="recherche", Position:=msoBarPopup, temporary:=True)
'insertion d'une zone de liste
Set Clist = Cbar.Controls.Add(msoControlDropdown)
With Clist
.TooltipText = "materiels (b21;b26)" '<-- info-bulle
.DropDownLines = 10 '<-- limitation de l'affichage à 10 lignes
.OnAction = "Macro1" '<-- procédure à exécuter
For x = 1 To 20
.AddItem ("v" & x) '<-- ajout de 20 Items
Next x
End With
End Sub
Sub Supp_barre_popup()
On Error Resume Next
CommandBars("MaBarrePopup").Delete
End Sub
Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 2009-03-06 par André
'
'
Range("B14:D24").Select
Range("B15").Activate
End Sub |
Partager