I am making a workbook for work. They want certain rows and checkboxes hidden untill a checkbox is activated. I got the code to hide them but if I save the file with them hidden and reopen the file and unhide them, all the checkboxes are in the wrong place. Is there any way to keep them to a cell or a different thing i should be using.
I'm using check box (form Control) for the checkboxes in the cells
The checkboxes for the code are ActiveX Control
Excel 2010
Thanks
Edit
I also need them to follow the cells =S
Code:
Private Sub CheckBox2_Click()
Dim i% 'for loops in If statments
Dim o%, cbf%, cbl%
o = 35 'object number
cbf = 36 'first checkbox number
cbl = 59 'last checkbox number
'stops page refresh
Application.ScreenUpdating = False
If CheckBox2.Value = True Then
Shapes("Object " & o).Visible = True
Rows("31:52").EntireRow.Hidden = False
For i = cbf To cbl
CheckBoxes("Check Box " & i).Visible = True
Next
Else
Shapes("Object " & o).Visible = False
Rows("31:52").EntireRow.Hidden = True
For i = cbf To cbl
CheckBoxes("Check Box " & i).Visible = False
Next
End If
'Refreshes Page
Application.ScreenUpdating = True
End Sub
I'm using check box (form Control) for the checkboxes in the cells
The checkboxes for the code are ActiveX Control
Excel 2010
Thanks
Edit
I also need them to follow the cells =S
Last edited: