juancho618
5/4/2018 - 1:44 PM

Excel Basic comparison loop

Excel Basic comparison loop

Private Sub CommandButton1_Click()
    Dim i, x As Integer
    
    i = 2
    While Sheet1.Cells(i, 2) <> Empty
        x = 2
        While Tabelle1.Cells(x, 2) <> Empty
            If (Sheet1.Cells(i, 2) = Tabelle1.Cells(x, 2)) Then
                Sheet1.Cells(i, 8) = "done"
                Tabelle1.Cells(x, 124) = "YES"
                If (CStr(Sheet1.Cells(i, 5)) = CStr(Tabelle1.Cells(x, 17))) Then
                    Sheet1.Cells(i, 9) = "same pay"
                End If
            End If
            x = x + 1
        Wend
        
        i = i + 1
    Wend
End Sub