Hi all
I have been trying to find a macro which will hide any rows where the entire range in columns C:M has a value of 0. I have found a macro which comes close but it seems to hide a bit too much.
If you see the attached sheet you will see I have highlighted some rows in Red these are rows I don't want this macro to hide and rows in Yellow which is does hide and I want it to hide.
If anyone can help me perfect this macro so it doesn't hide the red rows I would be grateful.DSO Report Latest (version 2) static.xls
This is the macro.
Sub Hide_Zero_Rows_All_Sheets() Dim ws As Worksheet, c As Range Application.ScreenUpdating = False On Error Resume Next For Each ws In ThisWorkbook.Worksheets Select Case ws.Name Case "Sheet1", "Sheet2" 'sheets to exclude 'do nothing Case Else 'hide rows on these sheets For Each c In ws.Range("C15:M148") c.EntireRow.Hidden = c.Value = 0 Next c End Select Next ws Application.ScreenUpdating = True End Sub
Bookmarks