Hi all, Im working on a spreadsheet that hides rows based on a form control checkbox, and also hides form control checkboxes within those rows.
Apparently there is a bug is MS2010 that wont allow this to be done using activeX checkboxes, so I'm structuring the spreadsheet to use form control checkboxes instead.
The code works just fine, but Id rather see it done in an array. (items in red need to move into a for-next loop)
This should be a breeze for most you, my vba skills are lacking these days.
Private Sub CheckBoxTest_Click()
If CheckBoxTest = True Then
[10:71].EntireRow.Hidden = False 'Unhide All
ActiveSheet.CheckBox1.Visible = True
ActiveSheet.CheckBox2.Visible = True
ActiveSheet.CheckBox3.Visible = True
ActiveSheet.CheckBox4.Visible = True
ActiveSheet.CheckBox5.Visible = True
ActiveSheet.CheckBox6.Visible = True
ActiveSheet.CheckBox7.Visible = True
Else:
[10:71].EntireRow.Hidden = True 'Hide All
ActiveSheet.CheckBox1.Visible = False
ActiveSheet.CheckBox2.Visible = False
ActiveSheet.CheckBox3.Visible = False
ActiveSheet.CheckBox4.Visible = False
ActiveSheet.CheckBox5.Visible = False
ActiveSheet.CheckBox6.Visible = False
ActiveSheet.CheckBox7.Visible = False
End If
End Sub
Bookmarks