Forum Discussion

Vannak's avatar
Vannak
Copper Contributor
Oct 17, 2025

How to delete hidden lines

How to delete hidden lines? I go to Find & Select -->Go to special -->Objects then I try to delete but can't , the processor speed become high above 4Ghz and become slow process. This file has size over 30MB. 

2 Replies

  • Sub deletehiddenrows()
    
    Dim i As Long
    
    For i = 1 To Range("A" & Rows.Count).End(xlUp).Row
    
    If Rows(i).Hidden Then
    Rows(i).Delete
    i = i - 1
    End If
    
    Next i
    
    End Sub

    This VBA macro deletes the complete hidden rows (from column A to XFD) in my sample file with 500000 rows very quickly.

Resources