+ Reply to Thread
Results 1 to 3 of 3

Delete rows for specific range

Hybrid View

  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Delete rows for specific range

    Hi

    This has probably already been asked before, but I would like to know how to delete rows if duplicates occur within Column A

    I'm editing the post, but basically remains the same query.

    I would like to delete rows if Cell A recognizes a duplicate (and delete the duplicate underneath it), however, if Column J has the word "FUTURE" in it, then it should be left all alone. In all other instances the duplicates should be deleted

    How does one go about this? The current code I'm using deletes any instances of duplicates in column A

    Sub RemoveDupe()
        Dim rCell As Range
        Dim rRange As Range
        Dim lCount As Long
         
        Set rRange = Range("A1", Range("A" & Rows.Count).End(xlUp))
        lCount = rRange.Rows.Count
         
        For lCount = lCount To 1 Step -1
            With rRange.Cells(lCount, 1)
                If WorksheetFunction.CountIf(rRange, .Value) > 1 Then
                    .EntireRow.Delete
                End If
            End With
        Next lCount
    End Sub
    All help is appreciated

    Regards
    Attached Files Attached Files
    Last edited by georgeanaprop; 12-04-2009 at 04:20 AM.

  2. #2
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Delete rows for specific range

    Edited post above
    Last edited by georgeanaprop; 12-04-2009 at 04:21 AM.

  3. #3
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Delete rows for specific range

    Not trying to sound pressing, but is anyone able to assist?

    Thanks

+ Reply to Thread

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