Reputation: 29
I added a macro to the Excel Cell Context Menu.
This is the main code,
Private Sub Workbook_Open()
Dim NewControl As CommandBarControl
Application.CommandBars("Cell").Reset
Set NewControl = Application.CommandBars("Cell").Controls.Add
With NewControl
.Caption = "Inserir Data"
.OnAction = "Module1.OpenCalendario"
.BeginGroup = True
End With
End Sub
Here you can see the result,
Ih there anyway to put this macro on the top of the menu?
Upvotes: 0
Views: 138
Reputation: 3324
Try:
Set NewControl = Application.CommandBars("Cell").Controls.Add(before:=1)
Upvotes: 1