Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XL97 VBA Delete Blank Rows Help!

Status
Not open for further replies.

vaneagle

Technical User
Apr 23, 2003
71
AU
Hi,

I have the following code. It is not deleting blank rows.ie.. nothing at all in the cell... what do I need to change ??

Code:
Sub DeleteEmptyRows()
    LastRow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count
    Application.ScreenUpdating = False
    For r = LastRow To 1 Step -1
        If Application.WorksheetFunction.CountA(Rows(r)) = 0 _
          Then Rows(r).Delete
    Next r
End Sub

Thanks in advance...
 
Vaneagle,

Are you sure that there is nothing at all in the undeleted blank rows.

I have tried the macro myself using xl97 and had no problems at all until I inserted a value into a cell somewhere along the row.

Might be worth checking this.

cheers,

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top