Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Folks,
I have a cell (F8) containing 7/14/2005, which translates to 38547 in the C# code-behind. I can translate 38547 to 7/14/2005 with the following: day_to_process = (Convert.ToDateTime("12/30/1899")).AddDays(Convert.ToDouble(((Excel.Range)rng Lookup.Cells[8,6]).Value2.ToString())); Anybody have a better way? -- Bob Sullentrup |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob,
I haven't got VS.NET available to test this at the moment, but how about something like this: DateTime day_to_process = DateTime.Parse((Excel.Range)rngLookup.Cells[8,6]).Text); -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm "Bob Sullentrup" wrote in message ... Folks, I have a cell (F8) containing 7/14/2005, which translates to 38547 in the C# code-behind. I can translate 38547 to 7/14/2005 with the following: day_to_process = (Convert.ToDateTime("12/30/1899")).AddDays(Convert.ToDouble(((Excel.Range)rng Lookup.Cells[8,6]).Value2.ToString())); Anybody have a better way? -- Bob Sullentrup |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Rob
DateTime.Parse(((Excel.Range)rngLookup.Cells[8,6]).Text.ToString()); works. -- Bob Sullentrup "Rob Bovey" wrote: Hi Bob, I haven't got VS.NET available to test this at the moment, but how about something like this: DateTime day_to_process = DateTime.Parse((Excel.Range)rngLookup.Cells[8,6]).Text); -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm "Bob Sullentrup" wrote in message ... Folks, I have a cell (F8) containing 7/14/2005, which translates to 38547 in the C# code-behind. I can translate 38547 to 7/14/2005 with the following: day_to_process = (Convert.ToDateTime("12/30/1899")).AddDays(Convert.ToDouble(((Excel.Range)rng Lookup.Cells[8,6]).Value2.ToString())); Anybody have a better way? -- Bob Sullentrup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Function - Date evaluation | Excel Worksheet Functions | |||
VSTO | Excel Discussion (Misc queries) | |||
Function with VSTO ? | Excel Programming | |||
VBA, UDFs and VSTO | Excel Programming | |||
VSTO 2.0 | Excel Programming |