Using an Option Button to control other Option Buttons

Airfix9

Well-known Member
Joined
Sep 23, 2005
Messages
886
Hi all,

Beginner programmer here - I tend to record macros and then go into the code to see what they have created, so VERY basic stuff. In short, please be kind to me!

I have a spreadsheet containing pairs of Option Buttons so that the user can make preference selections on how data is displayed on another sheet within the file - there are around a dozen Yes/No options shown.

What I would like to do is to put in another pair of Option Buttons which will select "Yes" to all or "No" to all. I can do this by using the Call function, but it doesn't actually select the Option Buttons properly - ie, if I say "No" to all, then the data changes on the correct sheet, but all the Option Buttons on the select sheet are set to "Yes" still.

How do I get the code to change whether each button is checked or unchecked?

Any help gratefully received!

Many thanks

AF9
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hello, you just need to use something like this:

Code:
optionbutton1.value=true
optionbutton2.value=true

So when you run the code, it will change the option buttons to true or false, whatever the situation.

-Farnuckl
 
Upvote 0
Thanks for that - actually managed to solve it myself. I didn't realise that you could link two buttons to a single cell and that that cell would determine whether the button was checked or unchecked. Now, on the "Yes to all" button, I have a macro that changes all the linked cells to the Yes value as well as calling the relevant macros.

VB - it'll either kill me or cure me!
 
Upvote 0

Forum statistics

Threads
1,215,727
Messages
6,126,512
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top