For i = 2 To rd
For j = i To rd1
If Sheets("D").Range("A" & i).Value <> Sheets("D1").Range("A" & j).Value Then
finalcnt = finalcnt + 1
Sheets("Difference").Range("A" & finalcnt).Value = Sheets("D").Range("A" & i).Value
Else
Exit For
End If
Next
If j > rd1 Then
finalcnt = finalcnt + 1
Sheets("Difference").Range("A" & finalcnt).Value = Sheets("D").Range("A" & i).Value
End If
Next
End Sub
Re: How to compare data between 2 worksheets and display the differences
Raj,
Please use code tags.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Re: How to compare data between 2 worksheets and display the differences
Also,
This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.
Bookmarks