Results 1 to 6 of 6

Thread: need help leaning or restructuring macro for highlighighting duplicates on large data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location

    need help leaning or restructuring macro for highlighighting duplicates on large data

    Option Explicit
    Sub DupFinder()
        Dim R As Range, t As Range
    
        Set t = Range("C5:G16")
        
        For Each R In t.SpecialCells(xlCellTypeConstants).Cells
            If Application.WorksheetFunction.CountIf(t, R.Value) > 1 Then
                R.Interior.ColorIndex = 3
            End If
        Next
    End Sub
    
    
    The current code owrks but noticed when i ran it it would hang up and I could'nt even use ESC to interupt it. I need it to run leaner and faster on large data. I also noticed that it highlighted a Duplicate 1-1-1-1-14 when it saw another that was close to a duplicate but not a match to 1-1-1-1-11. It’s like it matched up to the first part of the last number.

    The example i attached shows data in column C E G but the data im using is in columns C5:G324632. dis regard data in column E.


    if possible a macro that works when I enter a range to find (highlight duplicates in red) duplicates.

    any help on this is appreciated
    Sincerely,
    Dennis
    Attached Files Attached Files
    Last edited by estatefinds; 08-09-2018 at 06:49 AM.

Posting Permissions

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