Results 1 to 6 of 6

Thread: Removing Duplicate Entries in a Column

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Maybe this..

    Sub testDup()
        Dim r As Long, x As Long
        r = Range("C65536").End(xlUp).Row
        For x = 2 To r Step 1
        If Range("C" & r).Value = Range("C" & r).Offset(-1).Value Then
            Range("C" & r).Offset(-1).EntireRow.Delete
        End If
        r = r - 1
        Next x
    End Sub

    Richie: The only reason I didn't step through backwards was because of the specifics on looking to delete the row above it, where that is somewhat 'traditionally' backwards. What do you think?
    Last edited by Aussiebear; 04-29-2023 at 09:40 PM. Reason: Adjusted the code tags

Posting Permissions

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