Results 1 to 2 of 2

Thread: [RESOLVED] Excel - Date bug with languages?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    816

    Resolved [RESOLVED] Excel - Date bug with languages?

    I don't think there is a solution to this but I'm hoping.

    I am using a macro to insert dates into a sheet. I want the dates to be formatted to display the month and year (mmm yyyy)

    dim myDate as Date
    myDate = DateSerial(2010,01, 01)
    [A1].Value = Format(myDate, "mmm yyyy")

    This works fine in English and inputs a date into the cell (01/01/2010) and displays "Jan 2010"

    When I change the language of the computer to Polish the cell is inputted as "Sty 2010" in text only. If double click cell, only then does it understand that "Sty 2010" is 01/01/2010 and it fixes itself. Why would it work in English and not so well in Polish?

    Can anyone think of a fix?

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    816

    Re: Excel - Date bug with languages?

    Second time in the last 24 hours where I've posted and then thought of a fix.

    Add the date and then format it.

    Summary.Cells(1, 1).Value = SheetDate
    Summary.Cells(1, 1).NumberFormat = "mmm yyyy"

    I think there is a problem manually formating cells to custom "mmm yyyy". Using

    Summary.Cells(1, 1).Value = SheetDate

    can override the format displaying 01/01/2010

Posting Permissions

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



Click Here to Expand Forum to Full Width