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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,225,051
Messages
6,182,571
Members
453,126
Latest member
NigelExcel

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