+ Reply to Thread
Results 1 to 2 of 2

Is there an easier way of doing this??

  1. #1
    Andy
    Guest

    Is there an easier way of doing this??

    I have checkboxes ,located in cells J95:J110, that will highlight a range of
    cells in a row if it is checked. My range is being highlighted is E95:I110

    Everytime the checkbox is checked the specific row range next to it
    highlights using conditional formatting.

    Currently to get this work i have the checkbox tell a cell next to the
    checkbox (cells H95:H110) to be True or False. So if the checkbox is check
    the cell next to it is true, and through conditional formatting highlight the
    cells. Also if that the checkbox is true, all the other checkboxes are false.

    For example, I have a checkbox is J96, if i check it, E96:I96 are
    highlighted, all the other checkboxes are false and thoughs ranges are
    unhighlighted.

    So here is my current code, and i was wondering if there is a faster or more
    easier way to write this.

    Private Sub CheckBox1_Click()
    ActiveSheet.Unprotect
    Select Case CheckBox1.Value
    Case Is = True
    Worksheets("BID RECAP SUMMARY").Range("K93") = "TRUE"
    CheckBox2.Value = False
    CheckBox3.Value = False
    CheckBox4.Value = False
    CheckBox5.Value = False
    CheckBox6.Value = False
    CheckBox7.Value = False
    CheckBox8.Value = False
    CheckBox9.Value = False
    CheckBox10.Value = False
    CheckBox11.Value = False
    CheckBox12.Value = False
    CheckBox13.Value = False
    CheckBox14.Value = False
    CheckBox15.Value = False
    CheckBox16.Value = False
    Case Is = False
    Worksheets("BID RECAP SUMMARY").Range("K93") = "FALSE"
    End Select
    ActiveSheet.Protect
    End Sub

  2. #2
    Jim Thomlinson
    Guest

    RE: Is there an easier way of doing this??

    Easier would be to use option buttons. Clicking one unclicks the other...
    --
    HTH...

    Jim Thomlinson


    "Andy" wrote:

    > I have checkboxes ,located in cells J95:J110, that will highlight a range of
    > cells in a row if it is checked. My range is being highlighted is E95:I110
    >
    > Everytime the checkbox is checked the specific row range next to it
    > highlights using conditional formatting.
    >
    > Currently to get this work i have the checkbox tell a cell next to the
    > checkbox (cells H95:H110) to be True or False. So if the checkbox is check
    > the cell next to it is true, and through conditional formatting highlight the
    > cells. Also if that the checkbox is true, all the other checkboxes are false.
    >
    > For example, I have a checkbox is J96, if i check it, E96:I96 are
    > highlighted, all the other checkboxes are false and thoughs ranges are
    > unhighlighted.
    >
    > So here is my current code, and i was wondering if there is a faster or more
    > easier way to write this.
    >
    > Private Sub CheckBox1_Click()
    > ActiveSheet.Unprotect
    > Select Case CheckBox1.Value
    > Case Is = True
    > Worksheets("BID RECAP SUMMARY").Range("K93") = "TRUE"
    > CheckBox2.Value = False
    > CheckBox3.Value = False
    > CheckBox4.Value = False
    > CheckBox5.Value = False
    > CheckBox6.Value = False
    > CheckBox7.Value = False
    > CheckBox8.Value = False
    > CheckBox9.Value = False
    > CheckBox10.Value = False
    > CheckBox11.Value = False
    > CheckBox12.Value = False
    > CheckBox13.Value = False
    > CheckBox14.Value = False
    > CheckBox15.Value = False
    > CheckBox16.Value = False
    > Case Is = False
    > Worksheets("BID RECAP SUMMARY").Range("K93") = "FALSE"
    > End Select
    > ActiveSheet.Protect
    > End Sub


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1