+ Reply to Thread
Results 1 to 7 of 7

Format a column as date format "yyyy-mm-dd"

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Format a column as date format "yyyy-mm-dd"

    Hi all,

    I'm trying to modify the following code to convert the date in column B of the "Export" worksheet to a "yyyy-mm-dd" format, but it doesn't work. The solution is probably extremely simple, but I'm still very new to VBA. Can someone help me with this?

    Thanks!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,513

    Re: Format a column as date format "yyyy-mm-dd"

    Try this

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-15-2012
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Format a column as date format "yyyy-mm-dd"

    Hi Jolivanes,

    I tried and it doesn't work - you mean replacing the following correct?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,513

    Re: Format a column as date format "yyyy-mm-dd"

    Both worked for me in 2007

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    The top one showed 2013/01/10 in the formatted cell but in the formula bar it shows 1/10/2013

  5. #5
    Registered User
    Join Date
    10-15-2012
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Format a column as date format "yyyy-mm-dd"

    Hmmm am i missing something? It just keeps showing "11/25/2012" for me. I need it to show "2012-11-25"

  6. #6
    Registered User
    Join Date
    10-15-2012
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Format a column as date format "yyyy-mm-dd"

    Okay I think I figured it out - the code originally didn't work because the input wasn't in the right format!

    Thanks for your help though!

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,513

    Re: Format a column as date format "yyyy-mm-dd"

    Glad it has been sorted

+ 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