Hello all. I have a massive spreadsheet with 100 columns of checkboxes (not my idea; but I'm stuck with it). Each checkbox is controlled individually; PLUS I want to have a "master" checkbox at the top of each column that will check each chechbox in its column, and control the value and formatting of the adjacent cell. I have created the below code, which does what I want. The problem is with this approach I will have to manually name 2 ranges for each of the 100 columns and modify the sub checkbox code to include the correct names for all one hundred columns of checkboxes.
I am hoping to have a macro which will point to ranges (row 2 to 313 of the column where the checkbox is located) and then control those ranges depending on the value of the checkbox. Thoughts?
Sub CheckBox1_Click()
If ActiveSheet.CheckBoxes("Check Box 1") = xlOn Then
ActiveSheet.Range("q3checkboxes").Value = 1
ActiveSheet.Range("q3data").Value = ".N"
ActiveSheet.Range("q3data").Interior.ColorIndex = 56
ActiveSheet.Range("q3data").Interior.Pattern = xlSolid
ActiveSheet.Range("q3data").Font.ColorIndex = 56
ElseIf ActiveSheet.CheckBoxes("Check Box 1") = xlOff Then
ActiveSheet.Range("q3checkboxes").ClearContents
ActiveSheet.Range("q3data").ClearContents
ActiveSheet.Range("q3data").Interior.ColorIndex = 0
ActiveSheet.Range("q3data").Interior.Pattern = xlSolid
ActiveSheet.Range("q3data").Font.ColorIndex = 0
End If
End Sub
Bookmarks