Creating a validation sheet with comparing two sheets & Columns.
Result should be "Match" or "Miss Match"
Sheet1 "A" = Sheet2 "A" Result in Sheet2 "D".
Sheet1 "B" = Sheet2 "B" Result in Sheet2 "E"
Sheet1 "C" = Sheet2 "C" Result in Sheet2 "F"
Rows may vary between 2 sheets.
I did the below code but its not working if we have duplicate line in sheet 2.
Result should be "Match" or "Miss Match"
Sheet1 "A" = Sheet2 "A" Result in Sheet2 "D".
Sheet1 "B" = Sheet2 "B" Result in Sheet2 "E"
Sheet1 "C" = Sheet2 "C" Result in Sheet2 "F"
Rows may vary between 2 sheets.
I did the below code but its not working if we have duplicate line in sheet 2.
Code:
Sub test()
Dim LA As Long
Dim LB As Long
Dim LC As Long
LA = Sheet2.Range("A999999").End(xlUp).Row
For i = 1 To LA
If Sheet1.Range("A" & i).Value = Sheet2.Range("A" & i).Value Then
Sheet2.Range("D" & i).Value = "Yes"
Else
Sheet2.Range("D" & i).Value = "No"
End If
LB = Sheet2.Range("A999999").End(xlUp).Row
'For i = 1 To LB
If Sheet1.Range("B" & i).Value = Sheet2.Range("B" & i).Value Then
Sheet2.Range("E" & i).Value = "Yes"
Else
Sheet2.Range("E" & i).Value = "No"
End If
LC = Sheet2.Range("A999999").End(xlUp).Row
'For i = 1 To LC
If Sheet1.Range("C" & i).Value = Sheet2.Range("C" & i).Value Then
Sheet2.Range("F" & i).Value = "Yes"
Else
Sheet2.Range("F" & i).Value = "No"
End If
Next
End Sub