Hi Guys,
I was hoping I could get some assistance. Basically what I required is to hide zero rows on multiple sheets within a book based on if the sum of the different columns = 0
So as an example I have data from Column E to Column K going down to 400 rows, so if in row 5 column e to column K the sum of all columns equal to zero I would like the row hiden. The range will be the same for every sheet.
I have looked at the below macro which works good, but it will only hide zero values if there is no Data in Column K only. What I require is a sum as oppose to just looking at one column.
Sub HideRows()
For Each sh In ThisWorkbook.Worksheets
For Each c In sh.Range("e5:k400")
If c.Value = 0 Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Next sh
End Sub
I was hoping I could get some assistance. Basically what I required is to hide zero rows on multiple sheets within a book based on if the sum of the different columns = 0
So as an example I have data from Column E to Column K going down to 400 rows, so if in row 5 column e to column K the sum of all columns equal to zero I would like the row hiden. The range will be the same for every sheet.
I have looked at the below macro which works good, but it will only hide zero values if there is no Data in Column K only. What I require is a sum as oppose to just looking at one column.
Sub HideRows()
For Each sh In ThisWorkbook.Worksheets
For Each c In sh.Range("e5:k400")
If c.Value = 0 Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Next sh
End Sub