PDA

View Full Version : [SOLVED] Need Help restructuriing Macro that highlights dups to highlight also partial



estatefinds
03-04-2017, 09:39 PM
I have Data in Column G in the form of combinations.
I need the Duplicate Macro to be restuctured to not only highlight the exact matches in column K but also to highlight the the data with at least 3 matching numbers within the combination, and four matching as well.

so for example G1 matches the data in K6 cause all 5 numbers match both would be highlighted.

in G2 with macro restuctured it would highlight it as it would match four of the numbers in K2 the 4-5-8-10

in the next example G10 the numbers 8-10-13 match the numbers in K9 cause the numbers 8-10-13 match.

Additional info.
the macro would start at at G1 highlight all matching based in the above description.
then it would continue to G2 and continue highlighting, Keep in mind once the data in column G and K is highlighted as the macro goes down the column anything highlighted will not be cleared, the ones allready highlighted will be skipped over as it is allready been highlighted.

Any Help on this is Appreciated!
Thank you in Advance:)

mana
03-04-2017, 10:48 PM
Option Explicit

Sub test()
Dim g As Range, k As Range
Dim s, e

For Each g In Range("g1", Range("g1").End(xlDown))
For Each k In Range("k1", Range("k1").End(xlDown))
s = Split(g.Value, "-")
For Each e In Split(k.Value, "-")
s = Filter(s, e, False)
Next
If UBound(s) < 2 Then
Union(g, k).Interior.Color = vbRed
End If
Next
Next

End Sub

estatefinds
03-05-2017, 10:05 AM
Great job!!!!!!! Thank you Very Much!!!!!!:)