+ Reply to Thread
Results 1 to 3 of 3

Checking and Changing Date Formats

  1. #1
    Forum Contributor
    Join Date
    11-28-2005
    Location
    Dover, England
    Posts
    172

    Checking and Changing Date Formats

    I automatically import data from a variety of sources – some of this data comes in as mm/dd/yy where other comes in as dd/mm/yy and I need it all as dd/mm/yy. Does anyone know how you can check the middle part of the date format to see if it is the current month and then if it identifies it as being incorrect then change its format accordingly? The importation is always done mid and end month so having a previous months date doesn't occur.

  2. #2
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    308

    Re: Checking and Changing Date Formats

    Hi Tellm

    Here are a Sub and a Function that might do what you want. You will need to pick one or the other.

    Please Login or Register  to view this content.
    Best regards. Rob.
    Last edited by rscsmith; 09-05-2012 at 03:31 AM. Reason: Error in code

  3. #3
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    308

    Re: Checking and Changing Date Formats

    PS - you can do this with a formula, rather than a macro. The formula would be:
    =IF(MONTH(A1)=MONTH(NOW()),A1,DATE(YEAR(A1),DAY(A1),MONTH(A1)))

    Best regards, Rob.

+ 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