Hi all,
I’m trying to delete the hidden rows and columns from thebelow table. I run a macro to autofilter 2 of the columns (8 & 10) but other than that it is unchanged. The original table is extracted from another document. I’vetried using the below VBA code that I found online however I get an error message saying:
Run time error 1004
Delete method ofRange class failed
Sub deletehidden()
For lp = 256 To 1 Step -1
If Columns(lp).EntireColumn.Hidden = True ThenColumns(lp).EntireColumn.Delete Else
Next
For lp = 65536 To 1 Step -1
If Rows(lp).EntireRow.Hidden = True ThenRows(lp).EntireRow.Delete Else
Next
End Sub
Any help would be greatly appreciated! J
I’m trying to delete the hidden rows and columns from thebelow table. I run a macro to autofilter 2 of the columns (8 & 10) but other than that it is unchanged. The original table is extracted from another document. I’vetried using the below VBA code that I found online however I get an error message saying:
Run time error 1004
Delete method ofRange class failed
Sub deletehidden()
For lp = 256 To 1 Step -1
If Columns(lp).EntireColumn.Hidden = True ThenColumns(lp).EntireColumn.Delete Else
Next
For lp = 65536 To 1 Step -1
If Rows(lp).EntireRow.Hidden = True ThenRows(lp).EntireRow.Delete Else
Next
End Sub
Any help would be greatly appreciated! J
Last edited: