Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert date like string to serial number
Hi All
Here is a simple question: How can I turn a date-like string (e.g. "01/01/07") to its date serial number equivalent (39083) using VB? I can do this easily in Excel itself (using the VALULE formulae or changing the cell type) but am struggling to do this in VB. Thanks in advance for any ideas. Chris |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert date like string to serial number
one way:
Dim nSerial As Long nSerial = CLng(DateValue("01/01/07")) In article . com, "Chrisso" wrote: Hi All Here is a simple question: How can I turn a date-like string (e.g. "01/01/07") to its date serial number equivalent (39083) using VB? I can do this easily in Excel itself (using the VALULE formulae or changing the cell type) but am struggling to do this in VB. Thanks in advance for any ideas. Chris |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert date like string to serial number
Thanks JE - just what I needed.
Strange that there is not a built in function to do this although its implementation would probably be the one you provided. It would make the code more readable. Chris JE McGimpsey wrote: one way: Dim nSerial As Long nSerial = CLng(DateValue("01/01/07")) In article . com, "Chrisso" wrote: Hi All Here is a simple question: How can I turn a date-like string (e.g. "01/01/07") to its date serial number equivalent (39083) using VB? I can do this easily in Excel itself (using the VALULE formulae or changing the cell type) but am struggling to do this in VB. Thanks in advance for any ideas. Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date String To Serial | Excel Discussion (Misc queries) | |||
convert serial number into date | Excel Discussion (Misc queries) | |||
How do I convert Date serial number to date | Excel Worksheet Functions | |||
format cells with ### as number, then convert to string showing date. | Excel Programming | |||
Convert date to serial number in VBA | Excel Programming |