Frank Freese
asked on
Form Control - set value of Option Button
Folks,
In my worksheet I have two option buttons as form controls. Each is assigned to a different macro.
When the workbook is activated I would like to set the "Format Control - Control - Value to be 'Unchecked' " for both form controls.
I've even tried changing the named in the "Name Box" from "Option Button 1" to "EvalPos" but that didn't work. If it was an ActiveX control - no problem. But it is a form control.
In my worksheet I have two option buttons as form controls. Each is assigned to a different macro.
When the workbook is activated I would like to set the "Format Control - Control - Value to be 'Unchecked' " for both form controls.
I've even tried changing the named in the "Name Box" from "Option Button 1" to "EvalPos" but that didn't work. If it was an ActiveX control - no problem. But it is a form control.
ASKER
Is the code from above line 2 correct?
For each on in sheets("sheet name").OptionButtons
For each on in sheets("sheet name").OptionButtons
ASKER
I get an error:
Object does not support this property or method at line 2.
Object does not support this property or method at line 2.
Sorry - typo - it should read
for each ob in sheets("Sheet name").optionbuttons
Only one option button on a sheet can be checked (or unchecked) at the same time.
You could use checkboxes instead.
Another way you could do it would be to put each option button inside it's own 'Group Box' control.
ASKER
I'm still making myself clear and I apologize.
Regardless of which form control I elect to use - radio or check mark, when the worksheet is activated I would like to clear any checks marks. Now when I open the worksheet the option button and /or check box retains the last selection and is not cleared. I do know when I right click on a form control select Format Control then the tab labeled Control there are two possible values available "Unchecked" and "Checked". I do not know how to set that value to "Unchecked" when the worksheet is activated for the two form controls I am using.When I tried Rory's suggestion at 40273265 and corrected the typo I received the message "Object does not support this property or method."
Regardless of which form control I elect to use - radio or check mark, when the worksheet is activated I would like to clear any checks marks. Now when I open the worksheet the option button and /or check box retains the last selection and is not cleared. I do know when I right click on a form control select Format Control then the tab labeled Control there are two possible values available "Unchecked" and "Checked". I do not know how to set that value to "Unchecked" when the worksheet is activated for the two form controls I am using.When I tried Rory's suggestion at 40273265 and corrected the typo I received the message "Object does not support this property or method."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
There you go my good man - you nailed it
thanks to all
thanks to all
ASKER
thank you very much
Open in new window