V
version83
Hello.
I have this code:
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVa
Target As Range, Cancel As Boolean)
Application.CommandBars("Cell").Reset
For Each Worksheet In Application.Worksheets
With Application.CommandBars("Cell").Controls
With .Add
.Caption = Worksheet.Name
.OnAction = "someMacro"
.Tag = "someTag"
.BeginGroup = True
End With
End With
Next
End Sub
It adds all sheets in the context menu.
There is just one more thing to be done.
When you click on a sheet from the context menu, it must becam
active.
Something like .OnAction = Worksheet.Select or a separate macro ....
I am not sure how to do it so i need some advice
I have this code:
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVa
Target As Range, Cancel As Boolean)
Application.CommandBars("Cell").Reset
For Each Worksheet In Application.Worksheets
With Application.CommandBars("Cell").Controls
With .Add
.Caption = Worksheet.Name
.OnAction = "someMacro"
.Tag = "someTag"
.BeginGroup = True
End With
End With
Next
End Sub
It adds all sheets in the context menu.
There is just one more thing to be done.
When you click on a sheet from the context menu, it must becam
active.
Something like .OnAction = Worksheet.Select or a separate macro ....
I am not sure how to do it so i need some advice