Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
An easier way? | Excel Discussion (Misc queries) | |||
There's Got to be an Easier Way | Excel Discussion (Misc queries) | |||
Easier Way to do it? | Excel Programming | |||
Is there an easier way? | Excel Discussion (Misc queries) | |||
Easier way? | Excel Programming |