Hi all, I'll start with the good news, in that I have managed to get all the VBA to work just how I want it to. My problem is that now every tie I need to edit the sheet or moving things round/add rows etc I need to make onerous modifications to the code!!
Basically I wasn't smart enough when I set up my coding at the start.
I have 30 checkboxes which control different rows. They are all sequential rows or groups of rows but no consistency in the number of rows in each group. I.e. 1-6 in one group, 7-10 in another 11-25 in the next etc.
I have used the following code to achieve what I was hoping for on my spread sheet:
As you can see each sub has the row numbers written in twice, which need to be edited twice every time something changes on my sheet.![]()
Private Sub CheckBox1_Click() 'aminebloom checkbox If Sheets("Sheet1").CheckBox1.Value = False Then Sheets("Sheet1").Rows("60:75").EntireRow.Hidden = True Else Sheets("Sheet1").Rows("60:75").EntireRow.Hidden = False End If End Sub
Is there a way that I can pre-define the groups of rows I want in one place, then get the code of each of the 30 checkboxes to refer to that?
I'm confident that it can be done, just not sure what the best way of doing it is? I do appreciate that I'll have to modify the code of each of the 30 checkboxes, but hopefully after this any modifications will be simpler!!!!
Most appreciated of any advice or help that can be offered
Regards
Paul
Bookmarks