1 Attachment(s)
[RESOLVED] Day/Month problem in Excel
Can anyone help me here?
Excel seems to be confusing the days and the months from what I think is very straight forward input. When you click on "new sheet" it should create a new sheet with the next montn in cell A3 (Febuary 2010) but the date it puts in is 02/01/2010. I can't find a workaround.
Re: Day/Month problem in Excel
i can not read your code, but try formatting the date to suit
sht.name = format(range("a3"), "mmmm yyyy")
Re: Day/Month problem in Excel
I want to put a date (1st Feb 2010) into a cell. Cell A3.
The cell has custom format to show month and year (mmmm yyyy)
SheetDate = DateSerial(2010, 2, 1)
[A3].Value = SheetDate
But for some reason A3 ends up as 2/01/2010 and displays January 2010.
Re: Day/Month problem in Excel
Why do you need the day part anyway if you don't want to show it?
Set the formatting of that cell to TEXT so that it doesn't apply extra intelligence and then do:
vb Code:
SheetDate = DateSerial(2010, 2, 1)
[A3].Value = Format(SheetDate,"MMMM yyyy")
Re: Day/Month problem in Excel
reset the format for that cell
Re: Day/Month problem in Excel
Perfect.
I thought
[A3].Value = Format(SheetDate, "MMMM yyyy")
would put text into the cell rather than a date. I was wrong.
Thanks!