Delete All Hidden Columns and Rows – VBA Excel – Code
This VBA code can help you delete all hidden columns and rows from your excel sheet with a click of a button.
|
1 2 3 4 5 6 7 8 |
<em>Sub hiddendelete()</em> <em>For lp = 256 To 1 Step -1 'loop through all columns</em> <em>If Columns(lp).EntireColumn.Hidden = True Then Columns(lp).EntireColumn.Delete Else</em> <em>Next</em> <em>For lp = 65536 To 1 Step -1 'loop through all rows</em> <em>If Rows(lp).EntireRow.Hidden = True Then Rows(lp).EntireRow.Delete Else</em> <em>Next</em> <em>End Sub</em> |
