ник: pashulka
Re: Контекстное меню (Excel) Private Sub ContextMenuCreate()
With Application.CommandBars.Add _
(Name:="ContextMenu", Position:=msoBarPopup)
With .Controls
With .Add(Type:=msoControlButton)
.FaceId = 277
.Style = msoButtonIconAndCaption
.Caption = "Добавить ..."
.OnAction = "Macros1"
End With
With .Add(Type:=msoControlButton)
.FaceId = 2112
.Style = msoButtonIconAndCaption
.Caption = "Удалить ..."
.OnAction = "Macros2"
End With
End With
End With
End Sub
Private Sub ContextMenuShow()
Application.CommandBars("ContextMenu").ShowPopup
End Sub
Private Sub Macros1()
MsgBox "Hello World", , ""
End Sub
Private Sub Macros2()
MsgBox "Adieu World", , ""
End Sub