Hi Trying to work out the syntax for adding more than item to a right click menu - "Insert Date" appears correctly but how do I get "A Date" and "IN Date" to appear on menu as well??
Private Sub Workbook_Open()
On Error Resume Next
Application.CommandBars("Cell").Controls("Insert Date").Delete
Dim NewControl As CommandBarControl
Set NewControl = Application.CommandBars("Cell").Controls.Add
With NewControl
.Caption = "Insert Date"
.OnAction = "Module1.OpenCalendar"
.BeginGroup = True
End With
End Sub
When I try to add the others I cant get the syntax right
Private Sub Workbook_Open()
On Error Resume Next
Application.CommandBars("Cell").Controls("Insert Date").Delete
Application.CommandBars("Cell").Controls("A Date").Delete
Application.CommandBars("Cell").Controls("IN Date").Delete
Dim NewControl As CommandBarControl
Set NewControl = Application.CommandBars("Cell").Controls.Add
With NewControl
.Caption = "Insert Date"
.OnAction = "Module1.OpenCalendar"
.BeginGroup = True
End With
Dim NewControl As CommandBarControl
With NewControl = Application.CommandBars("Cell").Controls.Add
.Caption = "A Date"
.OnAction = "Module1.OpenCalendar1"
.BeginGroup = True
End With
Dim NewControl As CommandBarControl
With NewControl = Application.CommandBars("Cell").Controls.Add
.Caption = "IN Date"
.OnAction = "Module1.OpenCalendar2"
.BeginGroup = True
End With
End Sub
any help appreciated
Bookmarks