+ Reply to Thread
Results 1 to 7 of 7

Date Format Problem

Hybrid View

  1. #1
    Registered User
    Join Date
    08-16-2008
    Location
    france
    Posts
    15

    Date Format Problem

    Hello,

    I am having an interesting issue with the cell data formatting. In the same column, i have dates being displayed in two formats:
    • format 1, e.g. 3/13/2008 (displayed on the left)
    • format 2, e.g. 2.12.2008 (displayed on the right)

    The format 2 is a date format for sure. However, the format 1 appears to be in general format. When i try to convert from general to date format such as format 2. it does not work, it does show the format is now a date format, but data is still displayed on the left and with its original display (ex. 3/13/2008).
    Of course by typing manually the date it works, but i have hundreds of lines in a similar state.

    does someone know how to change format 1 cell into dates without having to update them manually ?
    Many thanks in advance !
    Antony

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Hi, try the following:
    select your range
    Select Data - Text to Columns
    Select Fixed width - Next - Next
    Under column data format check "date" and select the date format you need ( depending on your regional settings you may have to try a couple of possibilities)
    That should do the trick

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Try this
    select column or range of dates
    Data Menu
    Text To Columns
    Delimited Option (can also use Fixed Width)
    Next Button
    Remove all ticks from Delimiters Check Boxes
    Next Button
    Select Date from Column Data Format option
    Select date format to suit (DMY)
    Finish Button

    Oops beaten by arthurbr
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  4. #4
    Registered User
    Join Date
    08-16-2008
    Location
    france
    Posts
    15

    date format, conversion general to text doesnt work

    Hi !
    Thanks both of you for your answers.
    However, it does not seem to work in this case. The format does change to date but the data is still displayed as mm/dd/yyyy and on the left side of the column.
    Would you have more suggestions ?

    Antony

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Not sure what you may be doing differently since this is the proper method.

    Try running this macro on the sheet where the dates reside. It presumes the data is in the B column starting at cell B2. Adjust the macro to point to the first cell.

    Also, you will have to highlight all the date cells before activating the macro:
    Sub DateConvert()
        Selection.TextToColumns Destination:=Range("B2"), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
            Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
            :=Array(1, 3), TrailingMinusNumbers:=True
    End Sub
    This does result i n all dates right-flush in the proper format.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    08-16-2008
    Location
    france
    Posts
    15

    Date Format Problem

    Hi !
    I've changed the date format to MDY in the last step and it works like a charm ! I thought the last option dealt with the output format but it was the input format (format#1 in the example).
    Thanks everyone for the help!

    Antony
    Last edited by babarorhum; 12-10-2008 at 09:25 AM. Reason: spelling mistakes

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Avec plaisir !

+ 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