Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default "1/1/1799" - is a date

Hi

How do I programmatically set a cell to accept "1/1/1799" as a date.

If I pass it in and then reset the NumberFormat of the cell or the column it
continues to see it as a string,

e.g.
MySheet.Cell(1,1).NumberFormat = "dd/mm/yyyy"
MySheet.Cell(1,1).FormulaR1C1 = Cstr(DateValue("1/1/1799"))

So if I want to show it as 01-Jan-1799 it refuses(!) to see it as a date
and continues to show 1/1/1799

Thanks

Simon




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default "1/1/1799" - is a date

Simon,

Excel doesn't support dates prior to 1-Jan-1900. Thus, 1/1/1799
is merely a text string.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Simon Woods" wrote in
message ...
Hi

How do I programmatically set a cell to accept "1/1/1799" as a

date.

If I pass it in and then reset the NumberFormat of the cell or

the column it
continues to see it as a string,

e.g.
MySheet.Cell(1,1).NumberFormat = "dd/mm/yyyy"
MySheet.Cell(1,1).FormulaR1C1 = Cstr(DateValue("1/1/1799"))

So if I want to show it as 01-Jan-1799 it refuses(!) to see it

as a date
and continues to show 1/1/1799

Thanks

Simon






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default "1/1/1799" - is a date

Simon, excel will not work with dates before 1/1/1900, have a look here
about working with pre 1900 dates
http://j-walk.com/ss/excel/usertips/tip028.htm

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Simon Woods" wrote in message
...
Hi

How do I programmatically set a cell to accept "1/1/1799" as a date.

If I pass it in and then reset the NumberFormat of the cell or the column

it
continues to see it as a string,

e.g.
MySheet.Cell(1,1).NumberFormat = "dd/mm/yyyy"
MySheet.Cell(1,1).FormulaR1C1 = Cstr(DateValue("1/1/1799"))

So if I want to show it as 01-Jan-1799 it refuses(!) to see it as a date
and continues to show 1/1/1799

Thanks

Simon






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default "1/1/1799" - is a date

Thanks Chip and Paul

It all makes sense, now!!!

Simon

"Paul B" wrote in message
...
Simon, excel will not work with dates before 1/1/1900, have a look here
about working with pre 1900 dates
http://j-walk.com/ss/excel/usertips/tip028.htm

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Simon Woods" wrote in message
...
Hi

How do I programmatically set a cell to accept "1/1/1799" as a date.

If I pass it in and then reset the NumberFormat of the cell or the

column
it
continues to see it as a string,

e.g.
MySheet.Cell(1,1).NumberFormat = "dd/mm/yyyy"
MySheet.Cell(1,1).FormulaR1C1 = Cstr(DateValue("1/1/1799"))

So if I want to show it as 01-Jan-1799 it refuses(!) to see it as a

date
and continues to show 1/1/1799

Thanks

Simon








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a "date selector box" or "pull down box" in a cell GaryK Excel Worksheet Functions 2 September 30th 09 01:45 AM
Convert numbers to date: "586" to read "May 1986" CEckels Excel Worksheet Functions 5 May 14th 09 04:46 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 01:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"