|
-
May 25th, 2001, 12:14 PM
#1
How to add command button to menu
I need help adding a command button to a menu. I have a command button that when pushed it should open up a menu, and on the menu I need a command button to appear there. Could anyone help me? It would be much appreciated. Thanks
-
May 25th, 2001, 04:40 PM
#2
Re: How to add command button to menu
Something like this perhaps?
Dim CBCitem as CommandBarControl
set CBCitem = CommandBars("Tools").Controls.Add(Type:=msoControlButton, before:=3)
With CBCitem
.Caption = "Your &Text Here..."
.FaceId = 0
.OnAction = "YourSubHere"
End With
Or did you want something on a UserForm? In that case, the sub you refer to in OnAction should call YourForm.Show, assuming you have created the form and named it YourForm.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|