Comparision between two sheets

     

     

    Private Sub CommandButton1_Click()

    Dim fc As Integer, fr As Integer
    fc = 1
    fr = 1
    Dim lr As Integer
    lr = Sheets("sheet2").Range(Cells(fr, fc), Cells(fr, fc).End(xlDown)).Rows.Count

    Dim sc As Integer, sr As Integer
    sc = 1: sr = 1


    For i = fr To lr

    If Sheets("sheet2").Cells(fr, fc) <> Sheets("sheet3").Cells(sr, sc) Then
    Sheets("sheet3").Cells(sr, sc).Interior.ColorIndex = 3
    End If
    fr = fr + 1
    sr = sr + 1
    Next

    End Sub

    Download The Workbook