I'm having trouble.... My loop has come to a cell where the first condition of the AND is true, and one of the second conditions of the OR is true (specifically the Sick Time condition). In this case I want the vba to move forward rather then exit the If, but it exits the If.
I suspect I have not written the AND/OR statement correctly as it treats only the 1st OR as the 2nd condition of the AND and not all the ORs together as the 2nd condition. Any assistance would be greatly appreciated.
I suspect I have not written the AND/OR statement correctly as it treats only the 1st OR as the 2nd condition of the AND and not all the ORs together as the 2nd condition. Any assistance would be greatly appreciated.
Code:
If Sheet3.Cells(I, 1) = Sheet5.Cells(C, 10) And _
(Sheet3.Cells(I, 2) = "Vacation/Personal - Employees Only" Or _
Sheet3.Cells(I, 2) = "Paid Leave - Employees Only" Or _
Sheet3.Cells(I, 2) = "Sick Time - Employees Only" Or _
Sheet3.Cells(I, 2) = "Holiday - Employees Only") Then
SickCheck = True
End If