Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Show Fridays date on monday
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Show Fridays date on monday
John
Do you really want Friday to be the hard-coded day or are you after the previous working day ? "John" wrote: 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Show Fridays date on monday
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" wrote: 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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Show Fridays date on monday
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 "John" wrote: 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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Show Fridays date on monday
Try it this way...
..Subject = "PKG Results - " & Format(Now - 1 + 2 * (Weekday(Now) = 2), "dddd, mmmm dd,yyyy") -- Rick (MVP - Excel) "John" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
a formula that returns the previous fridays date | Excel Worksheet Functions | |||
Date calculation for Monday of one month to the Monday of the next | Excel Discussion (Misc queries) | |||
formula for last Fridays date | Excel Discussion (Misc queries) | |||
show fridays | Excel Worksheet Functions | |||
Auto_Open() How to show prior Monday? | Excel Discussion (Misc queries) |