Results 1 to 2 of 2

Deleting empty rows

Threaded View

  1. #1
    Registered User
    Join Date
    02-15-2009
    Location
    NJ
    MS-Off Ver
    Excel 2003
    Posts
    8

    Deleting empty rows

    Hi,

    I'm trying to only delete the empty rows on a specific sheet, on the codition that if the former cell and latter cell both contain a value then to delete the empty row.

    Something just isn't right with my code (below) Any input would be greatly appreciated

    Sub Rwdelete()
    Dim i As Long
    Sheet4.Activate
    For i = 20000 To 2 Step -1
        If Not IsEmpty(Cells(i - 1, 1)) And Not IsEmpty(Cells(i + 1, 1)) Then Rows(i).Delete
    Next i
    End Sub
    Last edited by Rawlings99; 03-26-2009 at 08:13 PM. Reason: Solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1