mapslat.blogg.se

Checkbox for excel 2010
Checkbox for excel 2010









checkbox for excel 2010

LinkCheckBoxes CheckBox17, CheckBox18, "Linksame" LinkCheckBoxes CheckBox15, CheckBox17, "LinkOpposite" LinkCheckBoxes CheckBox14, CheckBox16, "LinkSame" LinkCheckBoxes CheckBox13, CheckBox14, "LinkSame" LinkCheckBoxes CheckBox11, CheckBox12, "ForceOpposite" LinkCheckBoxes CheckBox9, CheckBox10, "ForceSame" LinkCheckBoxes CheckBox7, CheckBox8, "FalseFalse" LinkCheckBoxes CheckBox5, CheckBo圆, "FalseTrue" LinkCheckBoxes CheckBox3, CheckBox4, "TrueFalse" LinkCheckBoxes CheckBox1, CheckBox2, "TrueTrue" Note how CheckBoxes 13,14 and 16 are all linked the same.

#Checkbox for excel 2010 code#

This code would be implemented by code like this in the Useform's code module. SubBox.Value = (pLinkType Like "*Opposite")īossBox.Value = SubBox.Value Xor (pLinkType Like "*Opposite") Mid(strType, 5, 1) = UCase(Mid(strType, 5, 1))Ĭase "Falsetrue", "Falsefalse", "Forcesame", "Forceopposite" Property Let LinkType(ByRef strType As String)Ĭase "Truetrue", "Truefalse", "Linksame", "Linkopposite" Public WithEvents SubBox As MSForms.CheckBox Public WithEvents BossBox As MSForms.CheckBox The SubBox of one clsLinkedCheckBox can be the BossBox in another.Ĭare should be taken to avoid recursive loops One checkbox can be the BossBox in several clsLinkedCheckBox objects. "LinkOpposite" keeps their values opposite, whenever either box is checked.

checkbox for excel 2010

LinkType "LinkSame" will make both boxes have the same value whenever either of them is checked or unchecked. (Clicking SubBox does nothing (other than change SubBox)) LinkType "ForceOpposite" makes SubBox the opposite of BossBox when BossBox is clicked. I have an external data table of all my open jobs which I refresh. Every month I create a billing worksheet. The Add method has a lot of arguments, but I only use a few, namely Class, Top, Left, Width, and Height. LinkType "ForceSame" will make the SubBox the same value as the BossBox whenever the BossBox is checked or unchecked. To add controls from the Control Toolbox (ActiveX controls) in VBA, I use the Add method of the OLEObjects collection. Similarly LinkType "FalseTrue" and "FalseFalse" will check or uncheck the SubBox when the BossBox is unchecked. Unchecking the BossBox or changing the SubBox has no effect. If LinkType = "TrueFalse", when the BossBox becomes True, the SubBox will become False.

checkbox for excel 2010

If the SubBox is checked or unchecked, nothing happens If the BossBox is unchecked, nothing happens. If LinkType is "TrueTrue", then when the BossBox is checked, the SubBox will become checked. Create a class module, use the Properties Window to change its name to clsLinkedCheckBox, put this code into that moduleĮach clsLinkedCheckBox object has a BossBox object (a checkbox control), a SubBox object (a checkbox control) and a string indicating LinkType











Checkbox for excel 2010