+ Reply to Thread
Results 1 to 4 of 4

Date showing mm-dd-yyyy instead of dd-mm-yyyy

  1. #1
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    Date showing mm-dd-yyyy instead of dd-mm-yyyy

    I am trying to write a date in "dd-mm-yyyy" format in excel sheet thru excel-vba. I achieved it using [a2].CurrentRegion.Columns("k").NumberFormat = "dd-mm-yyyy”
    and my cell value comes out to be 17-02-2021 , which is good.....
    But there is some weird problem... Since I have to iterate the startDate for whole month by everytime adding it by 1, so the next value comes out to be 02-01-2021 instead of 01-02-2021 until 12th of each month 12-02-2021 and from 13th, the month is again changing to two digits 13-02-2021

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Date showing mm-dd-yyyy instead of dd-mm-yyyy

    kirana,

    This works on mine:

    Please Login or Register  to view this content.
    Ochimus
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-20-2007
    Location
    Felixstowe, England
    MS-Off Ver
    Excel 2013, 2019
    Posts
    217

    Re: Date showing mm-dd-yyyy instead of dd-mm-yyyy

    cross posted : https://www.mrexcel.com/board/thread...-yyyy.1162418/

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Date showing mm-dd-yyyy instead of dd-mm-yyyy

    kirana2014, when you cross-post it is required to include links. Mr. Excel has the same rule. You have GlennUK to thank for posting it for you.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

+ 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: 3
    Last Post: 04-25-2019, 11:05 AM
  2. Replies: 3
    Last Post: 07-14-2016, 06:36 PM
  3. Replies: 8
    Last Post: 10-02-2013, 06:23 PM
  4. Replies: 7
    Last Post: 11-18-2012, 02:28 PM
  5. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 PM
  6. Copy+Paste macro dd/mm/yyyy to dd/mm/yyyy and NOT dd/mm/yyyy to mm/dd/yyyy
    By uimhirADo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2012, 03:45 AM
  7. [SOLVED] opening excel file -> date format problem: DD/MM/YYYY vs MM/DD/YYYY
    By yung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2005, 09:06 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