Retrieving the value of a checkbox, name of checkbox is given RRS feed

  • Question

  • I created  hierarchical trees in a spreadsheet with checkboxes and lines. The checkboxes are named according to their position in the tree, e.g. for a tree with 4 levels the first end leaf will have the name "firstTree1_1_1_1_" the second one "firstTree1_1_1_2_" etc ...

    The name of the boxes are stored in a range of length the number of terminal leaves. ("SegmentParameters")

    I try to access the value of all the terminal leaves with the statement (withTree being a boolean

    For i = 1 To segNum
            If withTree Then
                If Sheets("Main").CheckBoxes("Box" & Range("SegmentParameters").Cells(i, 2)).value = 1 And _
                    Sheets("Main").CheckBoxes("DisBox" & Range("SegmentParameters").Cells(i, 3)).value = 1 Then
                          isSelected = True

    etc ......

    This works for all values of i but 11 and 12 and cannot find a reason why. The names stored in the range are correct.

    All hints are welcome

    Tuesday, November 4, 2014 7:22 PM

All replies

  • Hi,

    >> This works for all values of i but 11 and 12

    Do you mean you don’t get the value of CheckBoxes?

    According to your description, I would like to know what’s the value of segNum.

    Please check the value of Range("SegmentParameters").Cells(i, 2/3) whether it is correct when i is 11 and 12.

    Please provide a screenshot of your Main sheet. If possible, you could share a sample file on the OneDrive.

    Best Regards


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 5, 2014 9:54 AM