ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Last friday (https://www.excelbanter.com/excel-programming/362982-last-friday.html)

gabch[_36_]

Last friday
 

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


Jeff Standen[_2_]

Last friday
 
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" wrote in
message ...

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




Ardus Petus

Last friday
 
lastFriday = date-(weekday(date,vbFriday)-1)

HTH
--
AP

"gabch" a écrit dans le
message de news: ...

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




Bob Phillips

Last friday
 
=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" wrote in
message ...

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





All times are GMT +1. The time now is 11:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com