Consulting

Results 1 to 2 of 2

Thread: Need help for searching duplicate rows in a worksheet

  1. #1

    Need help for searching duplicate rows in a worksheet

    Hi,

    I need help in dentifying duplicate rows (may be more than one) in a worksheet. I tried searching data over the net for this, but need some specific help.

    I had attached a sample worksheet with 5-6 rows, out of these 3 rows are identical.
    I need to get a function going that will
    1) identify the row & get the duplicate count.
    2) neglect this row and go for next row for processing.

    Can anyone guide me best possible way to get this done?

    Thanks in advance...
    Cheers!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]
    Public Sub ProcessData()
    Const FORMULA_COUNT As String = _
    "=SUMPRODUCT(--(B<row>:B<lastrow>=B<row>),--(C<row>:C<lastrow>=C<row>),--(D<row><lastrow>=D<row>),--(E<row>:E<lastrow>=E<row>))"
    Dim i As Long
    Dim LastRow As Long

    With ActiveSheet

    LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
    For i = 2 To LastRow

    If .Evaluate(Replace(Replace(FORMULA_COUNT, "<row>", i), "<lastrow>", LastRow)) = 1 Then

    Debug.Print i
    'process it
    End If
    Next i

    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

Posting Permissions

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