Try with this code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Ws As Worksheet
Dim RowCheck As Long
Set Ws = ActiveSheet
Application.ScreenUpdating = False
With Ws
For RowCheck = 1 To .Cells(.Rows.Count, 1).End(xlUp).Row
If .Cells(RowCheck, 1) = 0 Then
.Cells(RowCheck, 1).EntireRow.Hidden = True
Else
.Cells(RowCheck, 1).EntireRow.Hidden = False
End If
Next RowCheck
End With
Application.ScreenUpdating = True
End Sub
Just a note: this code will run with ANY change made on your sheet. If you have a lot of information on it, it might make your machine slow. I would advice to place a button with a macro attached to it so that the user clicks on it before using the data on the sheet, instead of using an event macro like this. Of course, that is my point of view and you might think you want it like this, I just wanted to tell you beforehand so you don't see any surprises.
Bookmarks