Results 1 to 4 of 4

Delete Rows

Threaded View

  1. #1
    Registered User
    Join Date
    05-02-2009
    Location
    New, New York
    MS-Off Ver
    Excel 2003
    Posts
    31

    Delete Rows

    I posted a similar post earlier this week, got an answer, and marked it as solved. Although the code is awesome its not working in all cases. Here is the code I have currently,

    Sub DeleteRows()
    Dim i As Long, LastRow As Long
    LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
        For i = LastRow To 1 Step -1
    If Cells(i, 1) <> "" Then
            If Cells(i, 6) >= 0 Then Rows(i).Delete
    End If
        Next
    End Sub
    My goal is to get Sheet1 to look like Sheet2 on the attachment with this post. If you can think of a better way to do this please let me know.

    This might give you an idea of what the macro is doing right now.

    1. Scan Column A for contents. As soon as you find a row with contents look at the same row in Column F. If the value in Column F is greater than or equal to zero delete the row and continue deleting rows until Column A has contents in it again, and repeat the pattern for every row in Column A and Column F.
    Attached Files Attached Files

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