Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone tell me how to clear a form? When I first pull my form up, which
has radio buttons with code, the buttons are clear but after I make a choice and pull it up again button is still indicated. I have to close the form and re-open it once again to clear. What am I not doing correctly? Thx -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200801/1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you hide the userform and then show it?
If yes, try unloading and then loading it. "Carrie_Loos via OfficeKB.com" wrote: Can anyone tell me how to clear a form? When I first pull my form up, which has radio buttons with code, the buttons are clear but after I make a choice and pull it up again button is still indicated. I have to close the form and re-open it once again to clear. What am I not doing correctly? Thx -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200801/1 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this: should work for both textbox & optionbutton
Private Sub CommandButton1_Click() ' Clear the form Dim ctrl As Control For Each ctrl In Me.Controls If TypeOf ctrl Is MSForms.TextBox Then ctrl.Value = "" ElseIf TypeOf ctrl Is MSForms.OptionButton Then ctrl.Value = False End If Next ctrl End Sub "Carrie_Loos via OfficeKB.com" wrote: Can anyone tell me how to clear a form? When I first pull my form up, which has radio buttons with code, the buttons are clear but after I make a choice and pull it up again button is still indicated. I have to close the form and re-open it once again to clear. What am I not doing correctly? Thx -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200801/1 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This works well - Thanks
Alpineman2 wrote: Try this: should work for both textbox & optionbutton Private Sub CommandButton1_Click() ' Clear the form Dim ctrl As Control For Each ctrl In Me.Controls If TypeOf ctrl Is MSForms.TextBox Then ctrl.Value = "" ElseIf TypeOf ctrl Is MSForms.OptionButton Then ctrl.Value = False End If Next ctrl End Sub Can anyone tell me how to clear a form? When I first pull my form up, which has radio buttons with code, the buttons are clear but after I make a choice and pull it up again button is still indicated. I have to close the form and re-open it once again to clear. What am I not doing correctly? Thx -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual basic, form does not show date correctly.... | Excel Worksheet Functions | |||
visual basic user form date format dd/mm/yy not mm/dd/yy | Excel Discussion (Misc queries) | |||
Inserting Form form Visual Basic... | Excel Programming | |||
Make a visual basic form fill a page | Excel Programming | |||
Using Visual Basic form to enter data | Excel Programming |