Im trying to compare two sheets which is sheet1 and sheet2 and print values in sheet3. When i am comparing between sheet1 and sheet2 and looking for non matching numbers, somehow my loop doesn't stop and lots of time its printing the samenumber. Here is my code but is there any other ways i can find non matching numbers between two sheets and paste it into sheet3.
lastrow1 = Sheets("Sheet1").UsedRange.Row - 1 + Sheets("Sheet1").UsedRange.Rows.Count
lastrow2 = Sheets("Sheet2").UsedRange.Row - 1 + Sheets("Sheet2").UsedRange.Rows.Count
a = 1
b = 1
c = 1
For i = a To lastrow1
For ii = b To lastrow2
If Worksheets("Sheet1").Cells(i, 1) <> Worksheets("Sheet2").Cells(ii, 1) Then
Worksheets("Sheet3").Range("A" & x) = Worksheets("Sheet1").Cells(i, 1)
x = x + 1
End If
Next ii
Next i