I created a custom right click menu for my excel sheet and was wondering if anybody could help me with getting the name on the drop down menu to appear in a cell on the sheet when clicked/selected. I have multiple items listed. Here is how i add the the items to the drop down.
Set cbr = Application.CommandBars.Add(cstrBarName, msoBarPopup, , True)
' add a couple of buttons
Set ctl = cbr.Controls.Add
With ctl
.Caption = L1
.OnAction = "'" & ThisWorkbook.Name & "'!macro1"
.Style = msoButtonCaption
End With
Set ctl = cbr.Controls.Add
With ctl
.Caption = L2
.OnAction = "'" & ThisWorkbook.Name & "'!macro2"
.Style = msoButtonCaption
End With
Set ctl = cbr.Controls.Add
With ctl
.Caption = L3
.OnAction = "'" & ThisWorkbook.Name & "'!macro2"
.Style = msoButtonCaption
End With
Thanks
Jeremy
Bookmarks