X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Delete All Empty Rows Without Resorting    
post Jan 13 2005, 04:27 PM

Posts: 434
Joined: 7-January 05
From: Graham, NC

Ever need to delete all of the empty rows in a spreadsheet WITHOUT resorting it? Here's some code to do just that:
Sub DeleteEmptyRows()
    LastRow = ActiveSheet.UsedRange.Row - 1 + _
    Application.ScreenUpdating = False
    For r = LastRow To 1 Step -1
        If Application.CountA(Rows(r)) = 0 Then Rows(r).Delete
    Next r
End Sub
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    20th November 2019 - 10:19 AM