Thread: [Solved] Hide Row With Zero Values
View Single Post
 
Old 03-18-2020, 08:01 AM
Marcia's Avatar
Marcia Marcia is offline Windows 7 32bit Office 2013
Expert
 
Join Date: May 2018
Location: Philippines
Posts: 527
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default

Right Jeffrey. I moved the End Select before Next ws. Thank you.
Code:
Sub HideZeroValueRows()
    Dim ws As Worksheet, rng As Range, cel As Range
    For Each ws In ThisWorkbook.Sheets
        Select Case ws.Name
            Case Is = "TB..GF 101", "TB..GF 20%", "TB..SEF", "TB..REG TF"
        Set rng = ws.Range("EG9", ws.Cells(Rows.Count, "EH").End(xlUp).Offset(-1))
        For Each cel In rng
            If cel.HasFormula And cel.Value = 0 Then cel.EntireRow.Hidden = True
        Next cel
        Case Is = "TB - ALL FUNDS", "TB..GF CONSO"
        Set rng = ws.Range("F9", ws.Cells(Rows.Count, "G").End(xlUp).Offset(-1))
        For Each cel In rng
            If cel.HasFormula And cel.Value = 0 Then cel.EntireRow.Hidden = True
        Next cel
        End Select
    Next ws
End Sub
We are on a mandatory Work-at-Home due to the COVID-19. We live in the mountains and we thought that we are safe but a seaman in a neighboring town came home positive...
Reply With Quote