Hi there,
Could you please advice how I could hide rows that don't return any value?
I've tried to adjust two different approaches but I guess they didn't work as there are still formulas in cells.
Thanks
Could you please advice how I could hide rows that don't return any value?
I've tried to adjust two different approaches but I guess they didn't work as there are still formulas in cells.
VBA Code:
Dim row As Range
Dim sheet As Worksheet
Set sheet = ActiveSheet
For i = 1 To sheet.UsedRange.Rows.Count
Set row = sheet.Rows(i)
If WorksheetFunction.CountA(row) = 0 Then
row.EntireRow.Hidden = True
End If
Next i
VBA Code:
Dim neValues As Range, MyRange As Range
Set MyRange = Rows("2:40")
On Error Resume Next
Set neValues = Intersect(ActiveCell.EntireRow.SpecialCells(xlConstants), MyRange)
On Error GoTo 0
If neValues Is Nothing Then
row.EntireRow.Hidden = True
End If
Thanks