Hey guys,
I have this macro to hide any row that has all zeroes or blank spaces. Or in my case - Don't hide the row if there is a digit different than 0 or blank space on a cell in any column from B to E:
Option Explicit
Public Sub HideRows()
Dim ws As Worksheet
Dim cell As Range
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
'It will hide all the rows if any of the cell contain a 0 in it
For Each cell In ws.Range("B1:E43")
cell.EntireRow.Hidden = (cell.Value = "0") Or (cell.Value = "")
Next cell
Next ws
Application.ScreenUpdating = True
End Sub
It hides most of the rows, however it also hides rows with numbers other than 0 or blank on it. I have attached an excerpt from the file I work on.
Where is the error in it ?
Thank you very much in advance!
Bookmarks