vendredi 25 janvier 2019

Macro not working when i have two conditions

I am trying to create a tracker that when "closed on time" or "Closed late" is chosen from a drop down, it automatically hides the entire row. I am currently using the below code, Closed late works but not the closed on time. Can anyone help?

Private Sub Worksheet_Change(ByVal Target As Range)
    BeginRow = 3
    EndRow = 700
    ChkCol = 14

    For RowCnt = BeginRow To EndRow
        If (Cells(RowCnt, ChkCol)(.Value = "Closed late")) And (.Value = "Closed on time") Then
            Cells(RowCnt, ChkCol).EntireRow.Hidden = True
        Else
            Cells(RowCnt, ChkCol).EntireRow.Hidden = False
        End If
    Next RowCnt
End Sub

Aucun commentaire:

Enregistrer un commentaire