Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I create an user form to run macros in excel?
I want to be able to have a user form with 4 checkboxes and a submit button.
The user can choose 1 or any combination of the checkboxes. Each of the checkboxes corresponds to a different macro. When the submit button is clicked, only the macros that the user has chosen will execute. How do I accomplish this? I've got the user form built; I'm just not quite sure how to code this to get the desired result. This form will be used in Excel 2003. Thanks. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I create an user form to run macros in excel?
Debra Dalgleish has good instructions........with pictures.......at her site.
http://www.contextures.on.ca/xlUserForm01.html Gord Dibben MS Excel MVP On Fri, 27 Apr 2007 13:06:00 -0700, mgj72394 wrote: I want to be able to have a user form with 4 checkboxes and a submit button. The user can choose 1 or any combination of the checkboxes. Each of the checkboxes corresponds to a different macro. When the submit button is clicked, only the macros that the user has chosen will execute. How do I accomplish this? I've got the user form built; I'm just not quite sure how to code this to get the desired result. This form will be used in Excel 2003. Thanks. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I create an user form to run macros in excel?
Something along these lines:
Checkboxes are "Checkbox1","Checkbox2" ..... Macros are "macro1","macro2" .... Private Sub CommandButton1_Click() ' "Submit button For i = 1 To 4 If Controls("Checkbox" & i).Value Then Run "macro" & i End If Next i End Sub HTH "mgj72394" wrote: I want to be able to have a user form with 4 checkboxes and a submit button. The user can choose 1 or any combination of the checkboxes. Each of the checkboxes corresponds to a different macro. When the submit button is clicked, only the macros that the user has chosen will execute. How do I accomplish this? I've got the user form built; I'm just not quite sure how to code this to get the desired result. This form will be used in Excel 2003. Thanks. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I create an user form to run macros in excel?
Thanks for the information. Do I need to set true/false values for each of
the checkboxes? "Toppers" wrote: Something along these lines: Checkboxes are "Checkbox1","Checkbox2" ..... Macros are "macro1","macro2" .... Private Sub CommandButton1_Click() ' "Submit button For i = 1 To 4 If Controls("Checkbox" & i).Value Then Run "macro" & i End If Next i End Sub HTH "mgj72394" wrote: I want to be able to have a user form with 4 checkboxes and a submit button. The user can choose 1 or any combination of the checkboxes. Each of the checkboxes corresponds to a different macro. When the submit button is clicked, only the macros that the user has chosen will execute. How do I accomplish this? I've got the user form built; I'm just not quite sure how to code this to get the desired result. This form will be used in Excel 2003. Thanks. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I create an user form to run macros in excel?
The true/false are set when you check/uncheck the check boxes. You may want
to set them to false initially and/or after macros have been executed: the latter to avoid inadvertently running the wrong macros if this could cause a problem. See the other reply re Debra's site which provides excellent examples and guidance. "mgj72394" wrote: Thanks for the information. Do I need to set true/false values for each of the checkboxes? "Toppers" wrote: Something along these lines: Checkboxes are "Checkbox1","Checkbox2" ..... Macros are "macro1","macro2" .... Private Sub CommandButton1_Click() ' "Submit button For i = 1 To 4 If Controls("Checkbox" & i).Value Then Run "macro" & i End If Next i End Sub HTH "mgj72394" wrote: I want to be able to have a user form with 4 checkboxes and a submit button. The user can choose 1 or any combination of the checkboxes. Each of the checkboxes corresponds to a different macro. When the submit button is clicked, only the macros that the user has chosen will execute. How do I accomplish this? I've got the user form built; I'm just not quite sure how to code this to get the desired result. This form will be used in Excel 2003. Thanks. |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do I create an user form to run macros in excel?
Thank you so much for your help! I think I'm on the right track now!
"Toppers" wrote: The true/false are set when you check/uncheck the check boxes. You may want to set them to false initially and/or after macros have been executed: the latter to avoid inadvertently running the wrong macros if this could cause a problem. See the other reply re Debra's site which provides excellent examples and guidance. "mgj72394" wrote: Thanks for the information. Do I need to set true/false values for each of the checkboxes? "Toppers" wrote: Something along these lines: Checkboxes are "Checkbox1","Checkbox2" ..... Macros are "macro1","macro2" .... Private Sub CommandButton1_Click() ' "Submit button For i = 1 To 4 If Controls("Checkbox" & i).Value Then Run "macro" & i End If Next i End Sub HTH "mgj72394" wrote: I want to be able to have a user form with 4 checkboxes and a submit button. The user can choose 1 or any combination of the checkboxes. Each of the checkboxes corresponds to a different macro. When the submit button is clicked, only the macros that the user has chosen will execute. How do I accomplish this? I've got the user form built; I'm just not quite sure how to code this to get the desired result. This form will be used in Excel 2003. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I am trying to create a form in Excel. In my form I want to be abl | Excel Discussion (Misc queries) | |||
Can I create an Excel User Form without VB install on my PC? | Excel Discussion (Misc queries) | |||
how to do a web query on an web browser on an user form using macros | Links and Linking in Excel | |||
Trouble with saving user input in an Excel Form. | Excel Discussion (Misc queries) | |||
Looking to create a simple user form with lookup | Excel Discussion (Misc queries) |