Hi,
How can I get last friday from today() in vba?
Thx
Hi,
How can I get last friday from today() in vba?
Thx
Depends when you consider your week to start, but
=TODAY()-WEEKDAY(TODAY())-1
Should probably do you. Weekday has various options for teh first day of the
week.
Jeff
"gabch" <[email protected]> wrote in
message news:[email protected]...
>
> Hi,
>
> How can I get last friday from today() in vba?
>
> Thx
>
>
> --
> gabch
> ------------------------------------------------------------------------
> gabch's Profile:
> http://www.excelforum.com/member.php...o&userid=30662
> View this thread: http://www.excelforum.com/showthread...hreadid=547383
>
lastFriday = date-(weekday(date,vbFriday)-1)
HTH
--
AP
"gabch" <[email protected]> a écrit dans le
message de news: [email protected]...
>
> Hi,
>
> How can I get last friday from today() in vba?
>
> Thx
>
>
> --
> gabch
> ------------------------------------------------------------------------
> gabch's Profile:
> http://www.excelforum.com/member.php...o&userid=30662
> View this thread: http://www.excelforum.com/showthread...hreadid=547383
>
=TODAY()-CHOOSE(WEEKDAY(TODAY()),2,3,4,5,6,0,1)
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
"gabch" <[email protected]> wrote in
message news:[email protected]...
>
> Hi,
>
> How can I get last friday from today() in vba?
>
> Thx
>
>
> --
> gabch
> ------------------------------------------------------------------------
> gabch's Profile:
http://www.excelforum.com/member.php...o&userid=30662
> View this thread: http://www.excelforum.com/showthread...hreadid=547383
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks