Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reference a checkbox control (Excel2000)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reference a checkbox control (Excel2000)

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

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reference a checkbox control (Excel2000)

    Hans,
    I created them from the Forms tooolbar.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reference a checkbox control (Excel2000)

    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)

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reference a checkbox control (Excel2000)

    Thanks,
    I will play around with the controls.

    Scott

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •