Show Fridays date on monday

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a VB code that will stamp the previous days date in the subject of an
e-mail. But on Monday I need it to post Friday's date. How can I do this?

Here is the code that I currently have.

..Subject = "PKG Results - " & Format(Now() - 1, "dddd, mmmm dd,yyyy")

Thank you for your help.
 
John

Do you really want Friday to be the hard-coded day or are you after the
previous working day ?
 
if day(now) = 2 then
.subject = "PKG Results - " & Format(Now() - 3, "dddd, mmmm dd,yyyy")
else
.subject = "PKG Results - " & Format(Now() - 1, "dddd, mmmm dd,yyyy")
end if
 
John,

Try this

If Weekday(Now) = 2 Then
Mydate = Now - 3
Else
Mydate = Now - 1
End If
..Subject = "PKG Results - " & Format(Mydate, "dddd, mmmm dd,yyyy")

Mike
 
Try it this way...

..Subject = "PKG Results - " & Format(Now - 1 + 2 * (Weekday(Now) = 2), "dddd, mmmm dd,yyyy")
 
Back
Top