ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with custom date formats (https://www.excelbanter.com/excel-programming/301718-problem-custom-date-formats.html)

Simon Woods[_3_]

Problem with custom date formats
 
Hi

I'm programmatically populating a column with dates of the format
"yyyymmdd". I'm setting the NumberFormat for the Column to "yyyymmdd". All
values which are being used are being displayed (eg 20000224) as

#########################

How get I get Excel to display the date "as is" whilst maintaining the date
data-type for the column.

Thanks

Simon



Michael Malinsky[_3_]

Problem with custom date formats
 
Excel does not recognize 20000224 as a date but as a number. The number
20000224 does not translate into an Excel date in any way (the highest date
allowed is 12/31/9999 which translates to 2,958,465). In your example, the
date of February 24, 2000 is equivalent to the date value of 36580 in Excel.
If you use 36580 and format it as yyyymmdd you will achieve the desired
result.

--
Michael J. Malinsky
Pittsburgh, PA

"I am a bear of very little brain, and long
words bother me." -- AA Milne, Winnie the Pooh

"Simon Woods" wrote in message
...
Hi

I'm programmatically populating a column with dates of the format
"yyyymmdd". I'm setting the NumberFormat for the Column to "yyyymmdd". All
values which are being used are being displayed (eg 20000224) as

#########################

How get I get Excel to display the date "as is" whilst maintaining the

date
data-type for the column.

Thanks

Simon





Simon Woods[_3_]

Problem with custom date formats
 
Thanks Michael

"Michael Malinsky" wrote in message
...
Excel does not recognize 20000224 as a date but as a number. The number
20000224 does not translate into an Excel date in any way (the highest

date
allowed is 12/31/9999 which translates to 2,958,465). In your example,

the
date of February 24, 2000 is equivalent to the date value of 36580 in

Excel.
If you use 36580 and format it as yyyymmdd you will achieve the desired
result.

--
Michael J. Malinsky
Pittsburgh, PA

"I am a bear of very little brain, and long
words bother me." -- AA Milne, Winnie the Pooh

"Simon Woods" wrote in message
...
Hi

I'm programmatically populating a column with dates of the format
"yyyymmdd". I'm setting the NumberFormat for the Column to "yyyymmdd".

All
values which are being used are being displayed (eg 20000224) as

#########################

How get I get Excel to display the date "as is" whilst maintaining the

date
data-type for the column.

Thanks

Simon








All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com