+ Reply to Thread
Results 1 to 4 of 4

Last friday

  1. #1
    Registered User
    Join Date
    01-20-2006
    Posts
    68

    Last friday

    Hi,

    How can I get last friday from today() in vba?

    Thx

  2. #2
    Jeff Standen
    Guest

    Re: 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" <[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
    >




  3. #3
    Ardus Petus
    Guest

    Re: Last friday

    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
    >




  4. #4
    Bob Phillips
    Guest

    Re: 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" <[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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1