Changing a form control with a form control

sinner8

New Member
Joined
Oct 19, 2013
Messages
2
I am in desperate need of some help with some form controls. I need a way to manipulate a group of check box forms and/or combo box forms with a macro assigned to a single form control. For example, clicking a single "check box A" would check off all the boxes in an associated group. Is this possible? Thanks to anybody who can help!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
If you link each of the check boxes in a "group" to the same cell, they will change all together. No macro needed.
 
Upvote 0
Mikerickson,

Thanks for your help! The issue I have with that method is that I need to have the subset boxes control linked cells independently. I have attached a link to an image displaying an example of what I am trying to accomplish. I simply need a "master checkbox to turn on or off a larger subset while maintaining the ability to manipulate each box in the subset individually. Thanks to anybody for the help!!!

View image: Form Control question
 
Upvote 0
You could assign this macro to each of you master checkboxes. Note that this code uses the Name of the check box, not its Caption. And that spaces and case sensitivity are important. Also, a box could (potentially) be the daughter boxes to more than one mother. Also a mother box could be the daughter to another box, just make sure to avoid circularity (i.e. no box is its own great-great----daughter).

Code:
Sub test()
    Dim MotherBox As Object
    Dim DaughterBoxNames As Variant
    Dim oneName As Variant
    
    If TypeName(Application.Caller) = "String" Then
        Set MotherBox = ActiveSheet.Shapes(Application.Caller)
    Else
        MsgBox "call this routine only by clicking a forms check box"
        Exit sub
    End If
    
    Select Case MotherBox.Name
        Case "Check Box A"
            DaughterBoxNames = Array("Check Box1a", "Check Box 2", "Check Box 3")
        Case "Check Box B"
            DaughterBoxNames = Array("Check Box 6", "Check Box 8", "Check Box 9", "Check Box 2")
    End Select
    
    
    For Each oneName In DaughterBoxNames
        ActiveSheet.Shapes(oneName).ControlFormat.Value = MotherBox.ControlFormat.Value
    Next oneName
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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