Mouse Menu

F

Frank Kabel

Hi
as starting point some code:
Sub Add_Item()
Dim New_Entry As Object
Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True)
On Error Resume Next
New_Entry.Controls("My message").Delete
On Error Goto 0

With New_Entry
.Caption = "My message"
.OnAction = "Message"
End With
End Sub


Sub Message()
MsgBox "Now you code yould start"
End Sub

Sub Delete_Item()
Dim myControl As CommandBarButton
For Each myControl In CommandBars("Cell").Controls
If myControl.Caption = "My message" Then
myControl.Delete
End If
Next
End Sub
--
Regards
Frank Kabel
Frankfurt, Germany

kidd golfer said:
Can I add specific commands to the "right-click" mouse menu? Can I
add macros?
 
G

Guest

Frank-

I am a beginner, so where do I add the code? In the beginning of the macro
that I created?

Thanks.
 
F

Frank Kabel

Hi
you have to add this basic principle to your code or call these
routines from your other code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top