Link to home
Start Free TrialLog in
Avatar of ilrosebud26
ilrosebud26Flag for United States of America

asked on

Add command button functions to menu in Excel

I have a command button which links to a user form.  On the user form there are several administrative tasks: format files, archive files, ftp files.  Is there a why to create an option on the menu bar to drive this tasks?  For example, the menu option would say: MyFileFunctions and Contain Format, Archive and FTP.  If there is any additional information needed from me, please let me know.
Avatar of Merch_Ops
Merch_Ops
Flag of United Kingdom of Great Britain and Northern Ireland image

Yes -

If not already done I would suggest you copy the code from the Click events of the buttons on your form into a new Module and turn them into normal Macros by renaming them like such:

sub ftp()
your code here...
end sub

Then right click on your menu bar and choose Customize...

Go to the Commands Tab. Scroll down the Catagories to find New Menu - from the Commands list drag New Menu up to your menu bar.

Next find Macros in the Categories list -  In the Commands list choose Custom Menu Item - drag this to the inside of your new menu. An box will then appear from which you can allocate one of your new macros to the button.

Alastair.

Avatar of ilrosebud26

ASKER

Alastair,
     Thanks, I will try ding this after lunch.

Rosemary
This works.  How do I activate if only a specific worksheet is open?

Rosemary
ASKER CERTIFIED SOLUTION
Avatar of Merch_Ops
Merch_Ops
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks,
    I will try this and see where I get.

Rosemary
I have created my add menu and delete menu macros and put them in this workbook declarations.  It seems to work OK.  Thanks!
Thanks for your help!!!
No probs, how come the B? Does anything need more clarification?