+ Reply to Thread
Results 1 to 4 of 4

Date & Month Switching Upon Copy

  1. #1
    Registered User
    Join Date
    01-27-2020
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    4

    Question Date & Month Switching Upon Copy

    Hello,

    I'm having an issue with some VBA that I've written. The purpose is to copy column by column into a particular format which is exported to be used as a load file. When I copy the column with the Start and End Dates, the dates change from dd/MM/yyyy to M/dd/yyyy or MM/dd/yyyy. Effectively the format is changing and I need it to retain the standard United Kingdom format that the user enters.

    I've tried multiple solutions ranging from the .NumberFormat on the entire column, .NumberFormat on every cell by looping, checking the Windows Settings and playing with the Data Types.

    Below is some of the example code where the copying is taking place:
    Please Login or Register  to view this content.
    I've also attached the workbook with a working example of data etc.

    Many thanks for all your help!
    Attached Files Attached Files
    Last edited by K26; 03-06-2020 at 10:35 AM. Reason: Marked as Solved

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2013
    Posts
    3,207

    Re: Date & Month Switching Upon Copy

    Hi there,

    See if making the highlighted addition to your code does what you need:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    01-27-2020
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    4

    Re: Date & Month Switching Upon Copy

    Thanks Greg!

    Seems to have fixed the issue. Would never have thought about trying to go at the File Settings!

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2013
    Posts
    3,207

    Re: Date & Month Switching Upon Copy

    Hi again,

    Many thanks for your feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

+ 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. Excel switching day and month around after entry.
    By wackywoo105 in forum Excel General
    Replies: 1
    Last Post: 02-18-2020, 07:44 AM
  2. Avoid Switching Sheets, Reference Sheet Without Switching Instead.
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2017, 06:59 PM
  3. [SOLVED] date keeps switching
    By joseph.davidow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-09-2016, 07:49 AM
  4. day and month switching in VBA userform
    By WhiteWaterMatt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2016, 10:09 AM
  5. Copy DATE as TEXT and display MONTH only
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-06-2013, 05:58 AM
  6. reference column date (yesterday) to get Month(Date) for copy paste
    By jukabub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-09-2013, 03:52 AM
  7. How do I copy only the month from a date
    By CCW in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-14-2005, 10:06 PM

Tags for this Thread

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