Consulting

Results 1 to 7 of 7

Thread: Help: How to get date input in specific syntax

  1. #1

    Help: How to get date input in specific syntax

    Hi All,

    You all may know, in some country the date format is different to English style. For example, in Vietnam, we note date like: dd/mm/yyyy not mm/dd/yyyy

    But with excel, it just understand date like: mm/dd/yyyy

    Is there anyway to get excel understand date when I input: dd/mm/yyyy?

    Thanks in advance

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    How are your requirements set in in Control Panel/Regional & Language Settings?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Excel understands many date formats, as a date is just a number since 1st Jan 1900, what you see on screen is just a presentational layer, and that can be formatted (almost) however you like. VBA is a bit trickier as VBA works with US style dates.

    Tell us the specific problem yu are getting.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    Thanks all,

    FYI, I input

    18/03/08 in cell A1 --> excel keep unchange
    03/18/07 in cell B1 --> excel understand and change it to 3/18/07

    make a subtraction: C1=A1-B1 ---> return value is: #VALUE!


    SO, excel just understand the B1 as date, but not A1

    What I mean in the above post is the input syntax. Excel force to input date under mm/dd/yy. If not, it wont be able to understand this as date type.

    It there anyway to change?
    Last edited by yurble_vn; 03-18-2008 at 07:59 AM.

  5. #5
    Thanksmdmackillop
    You right,

    But after this, can I conclude that this depends totally on machine. And can not customize in a particular excel file?

    THanks

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Cells can be custom formatted to any acceptable format. If there is a danger of confusion, maybe you could use "d mmm yy" as your Short Date.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I find that 03/18/07 is not recognised as a date (nor would I expect it to be)
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •