Hello,
I know this is going to be painfully simple - but I need help.
Here is what I would like to do - if Cell B31 is true - I would like for an email to be sent to just one person
however - if it is False or blank, I would like to have the file sent to 2 people.
Here is my code - I keep getting an error (Object not found).
Sub Send_Mail()
Dim recipArr(1) As String
Dim CellValue As String
recipArr(0) = "person1@work.com"
recipArr(1) = "person2@work.com"
CellValue = cell.Range("B31").Value
If CellValue = "TRUE" Then
ActiveWorkbook.Save
ActiveWorkbook.SendMail Recipients:="person1@work.com", Subject:="Injuries"
Else
ActiveWorkbook.Save
ActiveWorkbook.SendMail Recipients:=recipArr, Subject:="Injuries"
End If
End Sub
Thank you in advance
I know this is going to be painfully simple - but I need help.
Here is what I would like to do - if Cell B31 is true - I would like for an email to be sent to just one person
however - if it is False or blank, I would like to have the file sent to 2 people.
Here is my code - I keep getting an error (Object not found).
Sub Send_Mail()
Dim recipArr(1) As String
Dim CellValue As String
recipArr(0) = "person1@work.com"
recipArr(1) = "person2@work.com"
CellValue = cell.Range("B31").Value
If CellValue = "TRUE" Then
ActiveWorkbook.Save
ActiveWorkbook.SendMail Recipients:="person1@work.com", Subject:="Injuries"
Else
ActiveWorkbook.Save
ActiveWorkbook.SendMail Recipients:=recipArr, Subject:="Injuries"
End If
End Sub
Thank you in advance