Results 1 to 4 of 4

Active X Checkboxes

This is a discussion on Active X Checkboxes within the Excel Questions forums, part of the Question Forums category; I have a form that has ~50 checkboxes. I want to be able to "reset" the checkboxes to false by ...

  1. #1
    kls
    kls is offline
    Board Regular
    Join Date
    May 2002
    Posts
    69

    Default

    I have a form that has ~50 checkboxes. I want to be able to "reset" the checkboxes to false by clicking on a command button. How do I group these checkboxes together so that I don't have to type CheckBox1.Value = False 50 times?!!

    I have a statement
    For i = 1 to 50
    Set.Checkbox(i).value = false
    Next i

    Only this is stopping after checkbox35.

  2. #2
    Board Regular s-o-s's Avatar
    Join Date
    Apr 2002
    Location
    Kissimmee, Florida
    Posts
    384

    Default

    On 2002-05-28 14:11, kls wrote:
    I have a form that has ~50 checkboxes. I want to be able to "reset" the checkboxes to false by clicking on a command button. How do I group these checkboxes together so that I don't have to type CheckBox1.Value = False 50 times?!!

    I have a statement
    For i = 1 to 50
    Set.Checkbox(i).value = false
    Next i

    Only this is stopping after checkbox35.
    I think this should do the trick...

    Code:
    Sub Chkb()
    
    For Each cb In ActiveSheet.CheckBoxes
        cb.Value = True
    Next
    End Sub
    Hope This Helps.
    Sean.
    Digest of Homes

    WinXP, XL XP

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,945

    Default

    Since you're using a Form, you can use something like

    For i = 1 to 50
    Me.Controls("CheckBox" & i).Object = False
    Next i

    Regards,

    Juan Pablo González
    http://www.juanpg.com

  4. #4
    kls
    kls is offline
    Board Regular
    Join Date
    May 2002
    Posts
    69

    Default

    Thank you very much

    This will work

Bookmarks

Posting Permissions

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


DMCA.com