I'm having the following code which removes empty rows from an excel sheet.
Code: Select all
Sub RemoveEmptyRows()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim rw As Long, iCol As Long
For rw = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If Application.CountA(Rows(rw).EntireRow) = 0 Then _
Rows(rw).Delete
Next
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
I want to point out that I have applied formulas to columns C, F, H & J within this range (A16:A35).
I don't want the formulas to be deleted when the rows are hidden.
I would be happy if you could help me with this.
Thanks in advance