Compare of two column
Closed
                    
        
                    dev_raghav1982
    
        
                    Posts
            
                
            1
                
                            Registration date
            Sunday June 25, 2017
                            Status
            Member
                            Last seen
            June 25, 2017
            
                -
                            Jun 25, 2017 at 02:56 AM
                        
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Contributor Last seen December 27, 2022 - Jun 27, 2017 at 11:20 AM
        TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Contributor Last seen December 27, 2022 - Jun 27, 2017 at 11:20 AM
        Related:         
- Compare of two column
- "Compare versions word" - Guide
- Beyond compare download - Download - File management
- How to delete column in word - Guide
- Excel count occurrences of string in column - Guide
- Display two columns in data validation list but return only one - Guide
1 response
                
        
                    TrowaD
    
        
                    Posts
            
                
            2921
                
                            Registration date
            Sunday September 12, 2010
                            Status
            Contributor
                            Last seen
            December 27, 2022
            
            
                    555
    
    
                    
Jun 27, 2017 at 11:20 AM
    Jun 27, 2017 at 11:20 AM
                        
                    Hi dev_raghav1982,
Give the following code a try and do comment on the result:
Best regards,
Trowa
            Give the following code a try and do comment on the result:
Sub RunMe()
Dim mValue As String
Dim x, y, mVar As Integer
Dim Mix As Boolean
x = 2
Do
    mValue = Range("A" & x).Value
    mVar = Range("B" & x).Value
    y = x
    
    Do While Range("A" & x) = mValue
        If mVar <> Range("B" & x).Value Then
            Mix = True
        End If
        x = x + 1
    Loop
    If Mix = True Then
        Range(Cells(y, "C"), Cells(x - 1, "C")).Value = "Mix"
    Else
        Range(Cells(y, "C"), Cells(x - 1, "C")).Value = "Non Mix"
    End If
    
    Mix = False
    
Loop Until Range("A" & x) = vbNullString
End Sub
Best regards,
Trowa
