User Form Macro

fmcc

New Member
Joined
Nov 1, 2011
Messages
3
I created 10 macros. I would like to now create a user form to call one of the macros.
Two questions:
1. For the user form I would like the user would type the macro name and press OK. Can anyone help me with this?

2. After I have the user form created how do I save the whole thing as an add in to use on any workbook.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Would they type the macro name into a cell or into a textbox etc... on the userform, you can set up the userform with various buttons so that they don't have to type the name of the macro.

Also which version of excel are you using, helps to know with adding the addin to excel.
 
Upvote 0
I like the button option instead of a text box. This would avoid the user putting in wrong macro name. So the add in will have 10 buttons. Would it be a menu bar with 10 buttons? How do I create this?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

I am using excel 2007.
 
Upvote 0
In the editor if you look on the second row of the toolbars there is a little toolbox button with a hammer and spanner crossing each other, if you click on it a little box will pop up top left side of the screen, it has various commands available, buttons, listboxes, labels etc... you can click on the command buttons and add them to your form, once on your form you can double click the commandbutton and it will come up with the following.

Code:
Private Sub CommandButton1_Click()
 
End Sub

Add your script into the the area between the 2 lines of script and each time someone clicks on it it will run the code, do that for each commandbutton that you add, the help menu in the editor is very useful for other information also, if you want to know more about userforms, commandbuttons etc...
 
Upvote 0

Forum statistics

Threads
1,225,847
Messages
6,187,366
Members
453,420
Latest member
ESCH1021

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top