Hello,

I am using the following VBA to delete hidden rows; the source table is no more than 10000 entries; it's working, this is running very slow and causing Excel to become unresponsive. I think I am making a mistake by not defining last row number and instead causing it to perform the calculation too many times; but I don't know how to do that.
Any help would be very much appreciated.
Below is the script:
Sub CCWF_B_DeleteHidden()
'
' CCWF_B_DeleteHidden
'

'
Sheets("CCWF_B").Select
For lp = 256 To 1 Step -1
If Columns(lp).EntireColumn.Hidden = True Then Columns(lp).EntireColumn.Delete Else
Next
For lp = 9999 To 1 Step -1
If Rows(lp).EntireRow.Hidden = True Then Rows(lp).EntireRow.Delete Else
Next
Sheets("Analyzer").Select
End Sub