Hi guys,
I'm trying to create a "front page" where a couple of checkboxes allow the user to unhide/hide rows in other sheets, based on the country value in the A column in these sheets. I've included my code for a single checkbox, which works well enough in terms of hiding rows when the checkbox in unchecked, but not in terms of unhiding rows that have previously been hiden. Any suggestions would be much aprreciated. Thanks!
I'm trying to create a "front page" where a couple of checkboxes allow the user to unhide/hide rows in other sheets, based on the country value in the A column in these sheets. I've included my code for a single checkbox, which works well enough in terms of hiding rows when the checkbox in unchecked, but not in terms of unhiding rows that have previously been hiden. Any suggestions would be much aprreciated. Thanks!
Code:
Sub Checkbox8_Click()
Dim cel As Range, rng As Range
Application.ScreenUpdating = False
If Sheets("Checklist").Range("M5") = True Then
Set rng = Worksheets("Tax").Range("A1", Worksheets("Tax").Range("A65536").End(xlUp))
For Each cel In rng
If cel.Value = "France" Then
cel.EntireRow.Hidden = False
End If
Next cel
Else
Set rng = Worksheets("Tax").Range("A1", Worksheets("Tax").Range("A65536").End(xlUp))
For Each cel In rng
If cel.Value = "France" Then
cel.EntireRow.Hidden = True
End If
Next cel
End If
Application.ScreenUpdating = True
End Sub