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 Moderator Last seen January 16, 2023 - Jun 27, 2017 at 11:20 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Jun 27, 2017 at 11:20 AM
Related:
- Compare of two column
- Compare two worksheets and paste differences to another sheet - excel vba free download ✓ - Excel Forum
- Macro to compare two excel sheets ✓ - Excel Forum
- Excel compare two columns for partial matches - Guide
- Beyond compare download - Download - File management
1 reply
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
547
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