"1/1/1799" - is a date

  • Thread starter Thread starter Simon Woods
  • Start date Start date
S

Simon Woods

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
 
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, 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 **
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top