A
asawyer
I have added the following to my right click before to add an item to the
menu bar.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Dim NewItem As CommandBarButton
Application.CommandBars("Cell").Reset
If Not Application.Intersect(Target, Range("c2:AZ1000")) _
Is Nothing Then
Set NewItem = Application.CommandBars("Cell").Controls.Add
With NewItem
.Caption = "Show Open Cuts/Po's"
.OnAction = "ShowDetail"
.BeginGroup = True
End With
End If
End Sub
However I'm now trying to add it to the right click on some cells that I
don't think have the "CELL" command bar as the one that's being used.
I'm trying to add it on a cell that is part of a MS Query.
Can you tell me the commandbar to add it to, or tell me some way to
determine what the command bar should be?
Thanks,
Alan Sawyer
menu bar.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Dim NewItem As CommandBarButton
Application.CommandBars("Cell").Reset
If Not Application.Intersect(Target, Range("c2:AZ1000")) _
Is Nothing Then
Set NewItem = Application.CommandBars("Cell").Controls.Add
With NewItem
.Caption = "Show Open Cuts/Po's"
.OnAction = "ShowDetail"
.BeginGroup = True
End With
End If
End Sub
However I'm now trying to add it to the right click on some cells that I
don't think have the "CELL" command bar as the one that's being used.
I'm trying to add it on a cell that is part of a MS Query.
Can you tell me the commandbar to add it to, or tell me some way to
determine what the command bar should be?
Thanks,
Alan Sawyer