+ Reply to Thread
Results 1 to 3 of 3

Macro changes format of date

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    Dunedin NZ
    MS-Off Ver
    Excel 2011
    Posts
    14

    Macro changes format of date

    Hey guys!

    I have this macro to save excel files as tab delimited files with the datum as name which is in cell B2.

    Please Login or Register  to view this content.
    It workes really nice but it alway changes the format of the datum within the files from dd/mm/yy into mm/dd/yy. How can I stop that?

    Thanks heaps!

  2. #2
    Registered User
    Join Date
    03-20-2012
    Location
    Dunedin NZ
    MS-Off Ver
    Excel 2011
    Posts
    14

    Re: Macro changes format of date

    I forgot to mention that it does not just change the format of the date in B2 but also in the whole column B.

    Thanks heaps!!!

  3. #3
    Registered User
    Join Date
    09-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Macro changes format of date

    This sounds like an issue similar to one I encountered when trying to paste dates in to a worksheet using a macro. The dates were being pasted from an external application called Clarity Open Workbench. The dates in this application were in UK format so 1 Dec 2011 appeared as 01/12/2011. The destination cells in Excel were formatted as "dd mmm yy" and the regional settings on my PC were correct.

    If I pasted the data manually using Ctrl+v it honoured the formatting just fine but when run in a macro using...
    Please Login or Register  to view this content.
    ...it screwed up the dates. So 01/12/2011 appeared in the cells in Excel as 12 Jan 11. The only way I could fix it in the macro was to remove the date format before pasting, then paste the data then reapply the correct date format. Like this:
    Please Login or Register  to view this content.
    Not sure if this helps.
    Last edited by Riggers; 03-23-2012 at 06:17 AM.

+ 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