Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control Box Option Buttons
Hey..
I need some help here . . . It's probably something very simple but dont have the know-how. How do you clear Option Boxes (the control box type) I know how t group them by group name -- but once selections have been made, yo cannot RESET or CLEAR the boxes. I really want to make a Button to ru a Macro that clears a form. Any help would be GREATLY appreciated -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control Box Option Buttons
Hi jlarkin,
I've never tried to do this before, so maybe there's an easier way. But you can create another OptionButton, make its GroupName the same as the others, and set its Visible property to False. Then, in the CommandButton's Click event, you can set the Value of that hidden OptionButton to True. That will force the others to be False (cleared). -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Hey.. I need some help here . . . It's probably something very simple but I dont have the know-how. How do you clear Option Boxes (the control box type) I know how to group them by group name -- but once selections have been made, you cannot RESET or CLEAR the boxes. I really want to make a Button to run a Macro that clears a form. Any help would be GREATLY appreciated. --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control Box Option Buttons
Jake Marx wrote:
I've never tried to do this before, so maybe there's an easier way. But you can create another OptionButton, make its GroupName the same as the others, and set its Visible property to False. Then, in the CommandButton's Click event, you can set the Value of that hidden OptionButton to True. That will force the others to be False (cleared). Wow, my fault! I swear I tried setting the Values to False, but I must have missed something. Per Bob's response, you should be able to set the values to False. Anyway, here's a routine that will "clear" all TextBoxes, CheckBoxes, and OptionButtons: Private Sub CommandButton1_Click() Dim ctl As Control For Each ctl In Controls If TypeOf ctl Is msforms.OptionButton Or _ TypeOf ctl Is msforms.CheckBox Then ctl.Value = False ElseIf TypeOf ctl Is msforms.TextBox Then ctl.Object.Text = vbNullString End If Next ctl End Sub -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control Box Option Buttons
|
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control Box Option Buttons
Something like
With ActiveSheet .OptionButton1.Value = False .OptionButton2.Value = False .OptionButton3.Value = False End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "jlarkin " wrote in message ... Hey.. I need some help here . . . It's probably something very simple but I dont have the know-how. How do you clear Option Boxes (the control box type) I know how to group them by group name -- but once selections have been made, you cannot RESET or CLEAR the boxes. I really want to make a Button to run a Macro that clears a form. Any help would be GREATLY appreciated. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Multiple sets of Option Buttons (Form Control) In Excell | Excel Worksheet Functions | |||
Option Buttons, Forms Control, Excel 2007 - 3 options | Excel Worksheet Functions | |||
Option Buttons/Radio Buttons | New Users to Excel | |||
Worksheets and Control Option Buttons | Excel Worksheet Functions | |||
How do I create a form in a worksheet with control option buttons. | New Users to Excel |