Consulting

Results 1 to 3 of 3

Thread: Solved: find duplicate entries in colunms

  1. #1

    Solved: find duplicate entries in colunms

    Hi all,

    Hope you can help with this one.
    I found lots of macros that will find duplicate entries in a single column and compare rows and then delete the duplicated, but can someone give me an example of how you would go about doing the same with multiple columns.

    i've attached an example worksheet in case i haven't explained myself well.

    Thanks,

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    ARe you sure it is just those, looks more to me

    [vba]

    Sub ClearDuplicates()
    Dim col As Range
    Dim cell As Range
    Dim LastRow As Long
    Dim LastCol As Long

    With Range("C1")

    LastRow = .CurrentRegion(.CurrentRegion.Count).Row
    LastCol = .CurrentRegion(.CurrentRegion.Count).Column

    For Each col In Columns("C").Resize(, LastCol).Columns

    For Each cell In col.Cells(1, 1).Resize(LastRow)

    If Application.CountIf(Columns(2).Resize(, cell.Column - 2), cell.Value) > 0 Then

    cell.ClearContents
    End If
    Next cell
    Next col
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    thanks XLD, that worked great.

    and you were right there were more. to many numbers !!

    thanks again.

    jazznaura

Posting Permissions

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