Results 1 to 25 of 25

Thread: [RESOLVED] Question regarding Controls

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2006
    Posts
    20

    Resolved [RESOLVED] Question regarding Controls

    Presently, I have a number of checkbox controls appropriately named:

    CheckBox1
    CheckBox2
    CheckBox3
    CheckBox4
    etc.

    Is there a way to use and array and loop to assign the name of the control instead of continually put a bunch of if's and else's. For example, this is what I have now:

    VB Code:
    1. If ActiveCell.Value = "NC" Then
    2.      CheckBox1.Value = False
    3. Else
    4.      CheckBox1.Value = True
    5. End If
    6.  
    7. If ActiveCell.Value = "NC" Then
    8.      CheckBox2.Value = False
    9. Else
    10.      CheckBox2.Value = True
    11. End If

    I can put the rest of the If's and Else's...but that's just bad programming. Any suggestions would be greatly appreciated!
    Last edited by Hack; Jan 26th, 2006 at 07:30 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width