I have a very large spreadsheet that has many (100+) ActiveX checkboxes, about half of the those are in control of hiding or un-hiding rows. Below is a string of codes that I have in place currently to make the page functional for my purposes but there is ALOT of code I had to write over and over (or copy and paste) for each ActiveX Control and its affiliated rows.
My question is this: is there a way to have one code for all or do they each need to be done separately as I have done already?
Private Sub CheckBox1_Click()
If CheckBox1.Value Then
Range("A19:C19").EntireRow.Hidden = False
Else
Range("A19:C19").EntireRow.Hidden = True
End If
End Sub
Private Sub CheckBox2_Click()
If CheckBox2.Value Then
Range("A21:C21").EntireRow.Hidden = False
Else
Range("A21:C21").EntireRow.Hidden = True
End If
End Sub
Private Sub CheckBox3_Click()
If CheckBox3.Value Then
Range("A23:C23").EntireRow.Hidden = False
Else
Range("A23:C23").EntireRow.Hidden = True
End If
End Sub
You guys are the best!!! THANK YOU
Bookmarks