Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    English american english date problem (00)

    I have a form which allows entry of a date,
    so i enter in 4/3/03 (4th of March "003")
    I use VBA code to place this figure onto my spreadsheet
    but on the spreadsheet it appears as 3/4/04 (3rd of April 03")

    Confused!
    need help !

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: English american english date problem (00)

    Great, those international issues, isn't it <img src=/S/smile.gif border=0 alt=smile width=15 height=15>.

    Once you do anythin through VBA, Excel starts using American formats for dates. When you need to enter them into cells, things tend to go wrong.

    This seems to work though:

    Sub test()
    Dim dDate As Date
    dDate = InputBox("gimme a date")
    ActiveCell.Value = dDate
    End Sub

    Whereas this fails:

    Sub test()
    Dim dDate As string
    dDate = InputBox("gimme a date")
    ActiveCell.Value = dDate
    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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