dimanche 13 décembre 2015

Cascading if statement not working

I am getting the compile error "Else without If" in the following part of my code. What's the issue and how do I fix it?

    If InStr(1, Worksheets("Raw data").Cells(i, 3), "1M") Then Call RowCopyPaste("AS-001", i, counter1M)
    counter1M = counter1M + 1

    ElseIf InStr(1, Worksheets("Raw data").Cells(i, 3), "2M") Then Call RowCopyPaste("AS-001", i, counter2M)
    counter2M = counter2M + 1

    ElseIf InStr(1, Worksheets("Raw data").Cells(i, 3), "3M") Then Call RowCopyPaste("AS-001", i, counter3M)
    counter3M = counter3M + 1

    End If

Aucun commentaire:

Enregistrer un commentaire