I'm creating a two sheet workbook where the first sheet will have questions and checkboxes for answers to the questions being asked. If the checkbox is selected we get a True response, if not false, the resultant is placed in row a. I copy the results from sheet A to sheet B. I'm trying to work on some VB code on sheet B to automatically hide rows if a value in a cell is False. If true it is to stay visible. My code isn't working though. Can anyone help?
Private Sub Worksheet_Calculate()
Dim LastRow As Long, c As Range
Application.EnableEvents = False
LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
On Error Resume Next
For Each c In Range("A1:A" & LastRow)
If c.Value = False Then
c.EntireRow.Hidden = True
ElseIf c.Value = True Then
c.EntireRow.Hidden = False
End If
Next
On Error GoTo 0
Application.EnableEvents = True
End Sub
Bookmarks