This will use Auto-Filter to hide/unhide rows based on changes in values in cells B8:B10 per your sample workbook.
It is much more efficient than looping.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
If Not Intersect(Target, Range("B8:B10")) Is Nothing Then
With Sheet1
.AutoFilterMode = False
.Range("B1").CurrentRegion.Offset(, 1).Resize(, 1).AutoFilter Field:=1, Criteria1:="<>0", Operator:=xlAnd, visibledropdown:=False
End With
End If
Application.ScreenUpdating = True
End Sub
Bookmarks