Hi all, I've added VBA code to my project:
The problem is that this seems to be conflicting with my Clear Data macro- specifically if I select "Clear All Data" all checkboxes should be returned to TRUE/FALSE depending on the values within a group of cells. This particular checkbox is set to be False by default on selecting Clearing Data.
If I click Clear Data when this checkbox is False, then there's no issue and the rest of the checkboxes get reset (plus any information added in textboxes and radio buttons).
If I click Clear Data when this checkbox is True, then I get the following error message:
Is there any way around this? If I remove the highlighted line, then if I unselect Checkbox22, the rows are visible, but if I select Checkbox22, then the rows are still visible, so that isn't an option.
Many thanks
Private Sub CheckBox22_Click()
If CheckBox22 = True Then
[17:18].EntireRow.Hidden = False
Else: [17:18].EntireRow.Hidden = True
End If
End Sub
The problem is that this seems to be conflicting with my Clear Data macro- specifically if I select "Clear All Data" all checkboxes should be returned to TRUE/FALSE depending on the values within a group of cells. This particular checkbox is set to be False by default on selecting Clearing Data.
If I click Clear Data when this checkbox is False, then there's no issue and the rest of the checkboxes get reset (plus any information added in textboxes and radio buttons).
If I click Clear Data when this checkbox is True, then I get the following error message:
with the following line highlighted:Run-time error '1004':
Unable to set the Hidden property of the Range class
Else: [17:18].EntireRow.Hidden = True
Is there any way around this? If I remove the highlighted line, then if I unselect Checkbox22, the rows are visible, but if I select Checkbox22, then the rows are still visible, so that isn't an option.
Many thanks