Forum Discussion

Diana703's avatar
Diana703
Copper Contributor
Sep 13, 2022
Solved

Excel Code to Send/Not Send Email Based on Date

I need to insert code into my existing macro that will send email based on two things:  1) If Cell P (Email Sent) has a date in it, don't send any email; 2) Send only email if Cell O (Review Date) is...
  • HansVogelaar's avatar
    HansVogelaar
    Sep 13, 2022

    Diana703 

    I was misled by your description. Change the line

            If Range("P" & r).Value = "" And Range("Q" & r).Value <> "" And Range("O" & r).Value >= Range("Q" & r).Value - 120 Then

    to

            If Range("P" & r).Value = "" And Range("Q" & r).Value <> "" And Range("O" & r).Value <= Date Then

Resources