Results 1 to 3 of 3

Thread: CheckBoxes (XP)

  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CheckBoxes (XP)

    I'm looking for a more efficient way of setting a number of checkboxes to a grayed out state. Let's say there are three checkboxes in this example

    I know that this code would work:

    CheckBox1.Enabled = False
    CheckBox2.Enabled = False
    CheckBox3.Enabled = False

    But what about something like this (I am not interested in using radio buttons):

    For i = 1 to 3
    CheckBox(i).Enabled = False
    Next i


    Thanks for your suggestion,
    John

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

    Re: CheckBoxes (XP)

    If this is on a userform, you can use

    Dim i As Integer
    For i = 1 To 3
    Me.Controls("CheckBox" & i).Enabled = False
    Next i

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CheckBoxes (XP)

    Hans,

    Thanks for the reply, it works just fine.

    Regards,
    John

Posting Permissions

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