• Reference a checkbox control (Excel2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Reference a checkbox control (Excel2000)

    • This topic has 4 replies, 2 voices, and was last updated 18 years ago.
    Author
    Topic
    #441127

    I have a worksheet with several checkboxes.
    How do I reference them in VBA to hide them or make them visible when the user clicks on certain items.

    Thanks,
    Scott

    Viewing 0 reply threads
    Author
    Replies
    • #1058448

      Did you create the check boxes from the Forms toolbar or from the Control Toolbox?

      • #1058450

        Hans,
        I created them from the Forms tooolbar.

        • #1058451

          Select a check box by right-clicking it.
          Switch to the Visual Basic Editor (Alt+F11).
          Activate the Immediate window (Ctrl+G).
          Type ? Selection.Name and press Enter.
          You’ll see the name of the check box, you’ll need this.

          To control the visibility of a check box named “Check Box 1”:

          ActiveSheet.Shapes(“Check Box 1”).Visible = False

          (or True, of course).

          To change its value:

          ActiveSheet.Shapes(“Check Box 1”).ControlFormat.Value = xlOn

          (or xlOff, of course)

    Viewing 0 reply threads
    Reply To: Reference a checkbox control (Excel2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: