ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set all option buttons on worksheet to off (https://www.excelbanter.com/excel-programming/382935-set-all-option-buttons-worksheet-off.html)

Newbeetle

Set all option buttons on worksheet to off
 
Hi I use the following below to set all checkboxes on sheet 1 to off, can the
same be done for option buttons on sheet 1. The option buttons used are from
the forms toolbar.


Private Sub clear_Click()
Worksheets("sheet1").CheckBoxes.Value = xlOff
End Sub


Have tried a copy of ideas but I haven't got there yet.
--
This post was created using recycled electrons!

Ken

Set all option buttons on worksheet to off
 
This seems to work fine for me:

Sub test()

For Each OptionButton In ActiveSheet.OptionButtons
OptionButton.Value = False
Next

End Sub

Good luck.

Ken
Norfolk, Va

On Feb 9, 4:45 pm, Newbeetle
wrote:
Hi I use the following below to set all checkboxes on sheet 1 to off, can the
same be done for option buttons on sheet 1. The option buttons used are from
the forms toolbar.

Private Sub clear_Click()
Worksheets("sheet1").CheckBoxes.Value = xlOff
End Sub

Have tried a copy of ideas but I haven't got there yet.
--
This post was created using recycled electrons!




Dave Peterson

Set all option buttons on worksheet to off
 
How about something like:

worksheets("Sheet1").OptionButtons.Value = False



Newbeetle wrote:

Hi I use the following below to set all checkboxes on sheet 1 to off, can the
same be done for option buttons on sheet 1. The option buttons used are from
the forms toolbar.

Private Sub clear_Click()
Worksheets("sheet1").CheckBoxes.Value = xlOff
End Sub

Have tried a copy of ideas but I haven't got there yet.
--
This post was created using recycled electrons!


--

Dave Peterson

Newbeetle

Set all option buttons on worksheet to off
 
Thanks Guys,


--
This post was created using recycled electrons!


"Dave Peterson" wrote:

How about something like:

worksheets("Sheet1").OptionButtons.Value = False



Newbeetle wrote:

Hi I use the following below to set all checkboxes on sheet 1 to off, can the
same be done for option buttons on sheet 1. The option buttons used are from
the forms toolbar.

Private Sub clear_Click()
Worksheets("sheet1").CheckBoxes.Value = xlOff
End Sub

Have tried a copy of ideas but I haven't got there yet.
--
This post was created using recycled electrons!


--

Dave Peterson



All times are GMT +1. The time now is 07:19 AM.

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