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.
Frank FreeseAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rory ArchibaldCommented:
You should be able to use a loop like:

Dim ob as OptionButton
For each on in sheets("sheet name").OptionButtons
   ob.Value = -4146
Next ob

Open in new window

0
Frank FreeseAuthor Commented:
Is the code from above line 2 correct?

For each on in sheets("sheet name").OptionButtons
0
Frank FreeseAuthor Commented:
I get an error:
Object does not support this property or method at line 2.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Rory ArchibaldCommented:
Sorry - typo - it should read
for each ob in sheets("Sheet name").optionbuttons

Open in new window

0
Martin LissOlder than dirtCommented:
Only one option button on a sheet can be checked (or unchecked) at the same time.
0
Martin LissOlder than dirtCommented:
You could use checkboxes instead.
0
Martin LissOlder than dirtCommented:
Another way you could do it would be to put each option button inside it's own 'Group Box' control.
0
Frank FreeseAuthor Commented:
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.After worksheet activatedWhen I tried Rory's suggestion at  40273265 and corrected the typo I received the message "Object does not support this property or method."
0
Martin LissOlder than dirtCommented:
Worksheets("Sheet1").Shapes("Name of checkbox").OLEFormat.Object.Value = Checked  'or Unchecked
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Frank FreeseAuthor Commented:
There you go my good man - you nailed it
thanks to all
0
Frank FreeseAuthor Commented:
thank you very much
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.