Hello!
I have a small problem...
In the code below the bold part checks if the row is empty or 0 and if it is empty or 0 the row should be hidden. My problem is that I want it to check both after text and numbers. The formula works great if there is numbers. If there is anything in one of the cells, the row shall not be hidden. In each cell there is a formula that gets the cell value from another sheet.
Can the formula be changed in any way or has the entire code be rewritten?
Sub HideRows()
With Application
.ScreenUpdating = False
.EnableEvents = False
Dim NC%
With Sheets("Table")
NC = .Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column + 1
With Range(.Cells(2, NC), .Cells(241, NC))
.Formula = "=SUM(RC2:RC8)<>0"
.Value = .Value
.Replace What:="False", Replacement:=""
On Error Resume Next
.SpecialCells(4).EntireRow.Hidden = 1
Err.Clear
End With
.Columns(NC).Clear
End With
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
/Rgds
Phprahl