I have 3 If statements that always result in true no matter the value of "dept".
If I remove two of the If statements leaving just one it works. What am I doing wrong?
Dim Dept As String
Dim wb As Workbook
Set wb = ThisWorkbook
Dept = Application.WorksheetFunction.VLookup(Name, Sheet1.Range("F10"), 1)
If Dept = "Dept1" Or "Dept2" Then
wb.SendMail "email address", Subject:="Subject heading 1"
End If
If Dept = "Dept3" Or "Dept4" Then
wb.SendMail "email address", Subject:="Subject heading 2"
End If
If Dept = "Dept5" Or "Dept6" Then
wb.SendMail "email address", Subject:="Subject heading 3"
End If
Application.WorksheetFunction.VLookup(.... Didn't know the built in formula functions were available like that. Thanks!