PDA

View Full Version : [SOLVED] Need help with highlighting duplicates of data in 3 columns, Please



estatefinds
08-07-2018, 07:58 AM
Sub DupFinder()Dim R As Range, t As Range
Set t = Range("C5:G16")
For Each R In t
v = R.Value
If Application.WorksheetFunction.CountIf(t, v) > 1 Then
R.Interior.ColorIndex = 3
End If
Next
End Sub






Im working with this code and trying to get the data to be highlighted in red when ever it finds a duplicate in any of the 3 columns.
I'm having trouble getting it to work with the data I have , its Deliminated meaning the data in each cell looks like this > 1-5-7-7-22.

I provided file and had done the highlighting of the duplicates in red manually.
Any help on this is appreciated!
Sincerely,
Dennis

Paul_Hossler
08-07-2018, 09:10 AM
THERE'S REALLY NO NEED TO SHOUT IN THE POST TITLE


Try something like this




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

estatefinds
08-07-2018, 09:57 AM
Thanks you very much!! it works great!!! I will remeber not to put in all caps. thanks Again!!!