• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

dATA COMPARISON AND HIGHLIGHTING

1 :select a cell in coloumn A (0002)

2: Fix this cell

3 : search this data (0002) is present in column E . If yes move to next step 4 , if no choose another data(0016) in coloumn A and proceed step 2

4: get all the data in coloun B 000292 000224 0002F5 0002F6 AND also get all the data in coloumn F 000292 000224 000252 000286. Now highlight the unique values.

5: similar comaprison in data of coloumn C FD8A 2802 2806 FDB6 and coloumn G FD8A 2802 5685 4789
 

Attachments

  • DATA COMPARISON AND HIGHLIGHTING.xlsx
    37.7 KB · Views: 5
This macro will do what you asked.
Code:
Sub SlowButSteady()
Dim pValue1 As Range, pValue2 As Range
Dim DTC1 As Range, DTC2 As Range
Dim Snap1 As Range, Snap2 As Range
Dim c As Range
 
Set pValue1 = Range("A2")
Set pValue2 = Range("E2")
 
Application.ScreenUpdating = False
Do
    If pValue1.Value > pValue2.Value Then
        Set pValue2 = pValue2.End(xlDown)
    ElseIf pValue1.Value < pValue2 < Value Then
        Set pValue1 = pValue1.End(xlDown)
    Else
        'Define our ranges to work with
        Set DTC1 = Range(pValue1.Offset(0, 1), pValue1.End(xlDown).Offset(0, 1).End(xlUp))
        Set Snap1 = Range(pValue1.Offset(0, 2), pValue1.End(xlDown).Offset(0, 2).End(xlUp))
 
        Set DTC2 = Range(pValue2.Offset(0, 1), pValue2.End(xlDown).Offset(0, 1).End(xlUp))
        Set Snap2 = Range(pValue2.Offset(0, 2), pValue2.End(xlDown).Offset(0, 2).End(xlUp))
        
        For Each c In DTC1
            If WorksheetFunction.CountIf(DTC2, c.Value) = 0 Then
                c.Interior.ColorIndex = 37
            End If
        Next
        For Each c In DTC2
            If WorksheetFunction.CountIf(DTC1, c.Value) = 0 Then
                c.Interior.ColorIndex = 37
            End If
        Next
        For Each c In Snap1
            If c.Value = "" Then Exit For
            If WorksheetFunction.CountIf(Snap2, c.Value) = 0 Then
                c.Interior.ColorIndex = 37
            End If
        Next
        For Each c In Snap2
            If c.Value = "" Then Exit For
            If WorksheetFunction.CountIf(Snap1, c.Value) = 0 Then
                c.Interior.ColorIndex = 37
            End If
        Next
        
        Set pValue1 = pValue1.End(xlDown)
        Set pValue2 = pValue2.End(xlDown)
    End If
Loop Until pValue1.Row > 2000 Or pValue2.Row > 2000
Application.ScreenUpdating = True
End Sub
 
Back
Top