lundi 13 juin 2016

What condition am I not fulfilling?

My criteria is correct, but the first Msg Box is never displayed. What am i missing?

Sub Crr_Premiums()

    Dim LastRow As Long
    Dim wb1 As Workbook
    Dim i As Long

    Set wb1 = Workbooks("macro all client v.01.xlsm")

    LastRow = wb1.Sheets("CGIBill").range("A:A").Find("Overall - Total", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

    For i = 21 To LastRow

If wb1.Sheets("CGIBill").Cells(i, 16) > "0" And wb1.Sheets("CGIBill").Cells(i, 17) = "0.00" Then

MsgBox 1

Else
MsgBox 2

End If

Next i
End Sub

Aucun commentaire:

Enregistrer un commentaire