ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   option buttons (https://www.excelbanter.com/excel-programming/363538-option-buttons.html)

Gina

option buttons
 
Hi,

I need some help on option buttons and tick boxes that I have on an Excel
worksheet. I have a button which I would like to run a macro which will
'refresh' the form so that any selections made are unselected but i can't
figure out how to do this option boxes and tick boxes. Can anyone please
help?

Gina

Tom Ogilvy

option buttons
 
Forms toolbar controls or Control Toolbox Toolbar controls?

for the latter

for each obj in Activesheet.OleObjects
if typeof obj.Object is MSforms.OptionButton or _
typeof obj.Object is MSforms.Checkbox then
obj.Object.Value = False
end if
Next


for forms controls

Sub ABCDEF()
Dim cbx As CheckBox, obtn As OptionButton
For Each cbx In ActiveSheet.CheckBoxes
cbx.Value = xlOff
Next
For Each obtn In ActiveSheet.OptionButtons
obtn.Value = xlOff
Next
End Sub

--
Regards,
Tom Ogilvy

"Gina" wrote:

Hi,

I need some help on option buttons and tick boxes that I have on an Excel
worksheet. I have a button which I would like to run a macro which will
'refresh' the form so that any selections made are unselected but i can't
figure out how to do this option boxes and tick boxes. Can anyone please
help?

Gina



All times are GMT +1. The time now is 02:57 PM.

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