Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there any way of re-setting spinners of combo-boxes back to zero easily
with one click instead of having to change each one individually? I am trying to create a form which requires selecting how many quantities you want and want to be able to save over the excel document, open it up re-set everything to zero and re-use it rather than having to save the document as something else and keeping a master document. I hope this makes sense, any help would be greatfully received! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just put a reset button on the form and set its on click event to set each
item to zero. -- -John Please rate when your question is answered to help us and others know what is helpful. "Marie" wrote: Is there any way of re-setting spinners of combo-boxes back to zero easily with one click instead of having to change each one individually? I am trying to create a form which requires selecting how many quantities you want and want to be able to save over the excel document, open it up re-set everything to zero and re-use it rather than having to save the document as something else and keeping a master document. I hope this makes sense, any help would be greatfully received! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Marie
one way to do it would be to set all the default values in the userform_initilize event then set a button to call it to reset the form Private Sub CommandButton1_Click() UserForm_Initialize End Sub Private Sub SpinButton1_SpinDown() ComboBox1.ListIndex = ComboBox1.ListIndex - 1 End Sub Private Sub SpinButton1_SpinUp() ComboBox1.ListIndex = ComboBox1.ListIndex + 1 End Sub Private Sub UserForm_Initialize() ComboBox1.List = Array("1", "2", "3", "4", "5", "6", "7") ComboBox1.ListIndex = 0 SpinButton1.Value = 0 End Sub hope this helps |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for this. Do you know if you can re-set combo or list boxes as well?
"Incidental" wrote: Hi Marie one way to do it would be to set all the default values in the userform_initilize event then set a button to call it to reset the form Private Sub CommandButton1_Click() UserForm_Initialize End Sub Private Sub SpinButton1_SpinDown() ComboBox1.ListIndex = ComboBox1.ListIndex - 1 End Sub Private Sub SpinButton1_SpinUp() ComboBox1.ListIndex = ComboBox1.ListIndex + 1 End Sub Private Sub UserForm_Initialize() ComboBox1.List = Array("1", "2", "3", "4", "5", "6", "7") ComboBox1.ListIndex = 0 SpinButton1.Value = 0 End Sub hope this helps |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Marie
You can reset both combo and listboxes by setting their list index to -1, putting the code below in the code for the reset button or userform_initialize event (depending on which option you went with from above) should do the trick ComboBox1.ListIndex = -1 ListBox1.ListIndex = -1 hope this helps steve |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great, thanks!
"Incidental" wrote: Hi Marie You can reset both combo and listboxes by setting their list index to -1, putting the code below in the code for the reset button or userform_initialize event (depending on which option you went with from above) should do the trick ComboBox1.ListIndex = -1 ListBox1.ListIndex = -1 hope this helps steve |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. This is helpful to me as well.
"Incidental" wrote: Hi Marie You can reset both combo and listboxes by setting their list index to -1, putting the code below in the code for the reset button or userform_initialize event (depending on which option you went with from above) should do the trick ComboBox1.ListIndex = -1 ListBox1.ListIndex = -1 hope this helps steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Getting Combo boxes to change options based on other Combo boxes. | New Users to Excel | |||
Problems designing combo boxes in forms in Excel 2003 | Excel Programming | |||
User Forms - Combo Boxes | Excel Discussion (Misc queries) | |||
Excel forms And combo boxes | Excel Programming | |||
Setting Property Values of Text Boxes within Forms | Excel Programming |