Forms: >Variable< ControlSource for checkbox?

tx12345

Board Regular
Joined
Aug 28, 2006
Messages
165
Hi

in the most basic userform with a checkbox, one can go to the ControlSource section of the checkbox object's properties and type in "A1" where each time the check box is selected A1 will then say "true".

But what if I want the ControlSource for the checkbox tied to a value in B1, for example. Thus when B1=2 then the controlsource for the checkbox will change to A2.

TIA!

tx
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Create a named formula (Insert | Name > Define...) For my test, I used
IndirectSource =INDIRECT("'Sheet2'!A"&Sheet2!$B$1) Note that I was using Sheet2 for my test.

Now, specify the control source as book1!indirectsource where book1 is the workbook name. For my test, I was using an unsaved workbook.
 
Upvote 0
hi

i just gave your code a try and the error message was "could not set the controlsource property. invalid property value"

any thoughts?
 
Upvote 0

Forum statistics

Threads
1,223,204
Messages
6,170,720
Members
452,350
Latest member
DrVanNostrand

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