R
Roger on Excel
I use code to hide empty rows on a sheet. This works fine if the cells dont
have formulas in them and are empty.
However, if I use formulas in those rows which return blank cells, the code
doesnt hide the rows.
Even though the formulas in the cells return a zero value based upon
criteria, the rows wont hide.
Here is the code i use:
Dim rng As Range
On Error Resume Next
Range("a28:a54").EntireRow.Hidden = False
Set rng = Range("a28:a54").SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng Is Nothing Then
rng.EntireRow.Hidden = True
End If
Can anyone suggest code which will hide the rows if the formulas in cells
a28 to a 54 return zero values?
Thanks,
Roger
have formulas in them and are empty.
However, if I use formulas in those rows which return blank cells, the code
doesnt hide the rows.
Even though the formulas in the cells return a zero value based upon
criteria, the rows wont hide.
Here is the code i use:
Dim rng As Range
On Error Resume Next
Range("a28:a54").EntireRow.Hidden = False
Set rng = Range("a28:a54").SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng Is Nothing Then
rng.EntireRow.Hidden = True
End If
Can anyone suggest code which will hide the rows if the formulas in cells
a28 to a 54 return zero values?
Thanks,
Roger