F
famdamly
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)
Dim icbc As Object
For Each icbc In Application.CommandBars("cell").Controls
If icbc.Tag = "octane" Then icbc.Delete
Next icbc
With Application.CommandBars("cell").Controls _
Add(Type:=msoControlButton, before:=6, _
temporary:=True)
Caption = "Octane"
OnAction = "octane"
Tag = "octane"
End With
End Sub
I copied and pasted this from the VB help section in excel. It works
good by itself. If I copy and paste again and change all the "octanes"
to something else and change the (what I think is the name) of the Sub
ever so slightly it doesn't work. Can you have more than one
sub-routine in the worksheet code?
There must be a way to modify the name of the Sub and keep it working
in unison with the original. Beats me.
Cancel As Boolean)
Dim icbc As Object
For Each icbc In Application.CommandBars("cell").Controls
If icbc.Tag = "octane" Then icbc.Delete
Next icbc
With Application.CommandBars("cell").Controls _
Add(Type:=msoControlButton, before:=6, _
temporary:=True)
Caption = "Octane"
OnAction = "octane"
Tag = "octane"
End With
End Sub
I copied and pasted this from the VB help section in excel. It works
good by itself. If I copy and paste again and change all the "octanes"
to something else and change the (what I think is the name) of the Sub
ever so slightly it doesn't work. Can you have more than one
sub-routine in the worksheet code?
There must be a way to modify the name of the Sub and keep it working
in unison with the original. Beats me.