Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Stored Dates
I have a UserForm that asks the user to select the year, the month, and the
day. How do I convert this to an Excel Stored Date without having to write it to a cell then extract the cell's value via .Formula? Thanks, -- Trent Argante [DC.J(510)] |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Stored Dates
Guessing at what you seek, use CLng.
In Immediate Window: ?CLng(#4/20/2007#) 39192 Hth, Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Stored Dates
Take a look at the DateSerial method in XL/VBA Help.
In article , Trent Argante wrote: I have a UserForm that asks the user to select the year, the month, and the day. How do I convert this to an Excel Stored Date without having to write it to a cell then extract the cell's value via .Formula? Thanks, |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Stored Dates
Merjet,
You are using literals in CLng(#4/20/2007#). But how do I use a variable? For Example, CLng(variable). Thanks, Trent Argante [DC.J(510)] *** Sent via Developersdex http://www.developersdex.com *** |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Stored Dates
JE,
DateSerial seems only to return standard dates. But, I think I need the 5-digit number that Excel stores behind the scenes so that I can compare/contrast dates from any country. Thanks, Trent Argante [DC.J(510)] *** Sent via Developersdex http://www.developersdex.com *** |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Stored Dates
Dim dt1 As Date
dt1 = Now Debug.Print CLng(dt1) The last line gives 39196 in the Immediate Window. Hth, Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Convert dates stored as text | Excel Discussion (Misc queries) | |||
Need to combine dates stored in seperate columns | Excel Discussion (Misc queries) | |||
How do I convert dates stored as dates to text? | Excel Discussion (Misc queries) | |||
Converting numbers stored as dates to text in Excel | Excel Discussion (Misc queries) | |||
convert dates stored as text to dates | Excel Programming |