ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Control Box Option Buttons (https://www.excelbanter.com/excel-programming/296007-control-box-option-buttons.html)

jlarkin

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


Jake Marx[_3_]

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/



Bob Phillips[_6_]

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/




Jake Marx[_3_]

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]


jlarkin[_2_]

Control Box Option Buttons
 
damn man, that worked perfectly... salute!

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com