+ Reply to Thread
Results 1 to 8 of 8

Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

  1. #1
    Registered User
    Join Date
    04-08-2017
    Location
    N/A
    MS-Off Ver
    2016
    Posts
    30

    Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

    Hello,

    I would appreciate your advice on how to make "WeekdayName" VBA function work with European date format (dd/mm/yyyy).

    Currently, I have the below line in my code which is returning an incorrect weekday name. The weekday name is based on mm/dd/yyyy format which seem to be the default for "WeekdayName" function.

    Please Login or Register  to view this content.
    Thanks in advance,
    K
    Last edited by jeffreybrown; 03-30-2019 at 10:40 AM. Reason: Please use code tags!

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,150

    Re: Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

    In my case it works correctly (on the date in the format "dd/mm/yyyy" and "dd-mm-yyyy", i.e. "29-03-2019" in 'D1' cell):

    Please Login or Register  to view this content.
    Works correctly ("Saturday") with both "0" and "2" parameters (firstdayofweek)

    , but it doesn't work correctly this:
    Please Login or Register  to view this content.
    returning the day at 1 earlier ("Friday") than it should.

  3. #3
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

    Maybe...
    Please Login or Register  to view this content.
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  4. #4
    Registered User
    Join Date
    04-08-2017
    Location
    N/A
    MS-Off Ver
    2016
    Posts
    30

    Re: Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

    @porucha vevrku,
    Thanks for your suggestions. However, aren't you using basically the same code as mine? Interestingly that it works for you.

    @WasWodge,
    Thanks for the suggestion, but unfortunately, it doesn't fix the problem.

    Note that unlike VBA's "WeekdayName", Excel's TEXT function returns the correct day:

    Example.jpg

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    04-08-2017
    Location
    N/A
    MS-Off Ver
    2016
    Posts
    30

    Re: Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

    Thank you, @shg. The "dddd" formatting is doing the job!

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

    You're welcome.

  8. #8
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Make "WeekdayName" Function Work With "dd/mm/yyyy" Format

    Deleted as should have been looking at column G in the latest image.
    Last edited by WasWodge; 03-30-2019 at 02:42 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. Replace date in "DD.MM.YYYY" with date "DD/MM/YYYY" format as soon as user hits enter
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2019, 09:12 AM
  3. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  4. Replies: 8
    Last Post: 06-21-2016, 08:56 AM
  5. Replies: 3
    Last Post: 01-02-2014, 02:15 PM
  6. [SOLVED] Convert from "general" (YYYYMMDD) to specific "custom" format (YYYY.MM.DD)
    By Ella_p in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2013, 02:23 AM
  7. If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 AM

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