Thread: [Solved] Hide Row With Zero Values
View Single Post
 
Old 03-17-2020, 05:24 AM
jeffreybrown jeffreybrown is offline Windows 10 Office 2016
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Hi Marcia,

How about this

Code:
Sub HideRow2()
    Dim c   As Range
    Dim ws  As Worksheet
    Dim rng As Range
    Application.ScreenUpdating = False
    For Each ws In ActiveWorkbook.Worksheets
        Set rng = ws.Range("J3:J" & ws.Range("A" & ws.Rows.Count).End(xlUp).Row)
        rng.Formula = "=IF(SUM(H3:I3),"""",""hide"")"
        For Each c In rng
            If c.Value = "hide" Then ws.Rows(c.Row).EntireRow.Hidden = True
        Next c
    Next ws
    Application.ScreenUpdating = True
End Sub
Reply With Quote