Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
text to date
Hi,
Is there a way that I can convert month and year numbers into dates in vba analagous to the "=Date()" function in excel. For instance, how can I convert 12/2005 into a date number in vba without using "=Date" in a worksheet cell? Thanks, Andrew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
text to date
Hi Andrew,
Try: '============= Public Sub Tester002() Dim DTE As Date DTE = DateValue("12/2005") MsgBox DTE End Sub '<<============= --- Regards, Norman "andrew" wrote in message oups.com... Hi, Is there a way that I can convert month and year numbers into dates in vba analagous to the "=Date()" function in excel. For instance, how can I convert 12/2005 into a date number in vba without using "=Date" in a worksheet cell? Thanks, Andrew |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
text to date
Hi Andrew,
use the DateValue function, directly available in VBA -- Kind regards, Niek Otten "andrew" wrote in message oups.com... Hi, Is there a way that I can convert month and year numbers into dates in vba analagous to the "=Date()" function in excel. For instance, how can I convert 12/2005 into a date number in vba without using "=Date" in a worksheet cell? Thanks, Andrew |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
text to date
Thanks! This is great
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date format to Text Date for use in Mail Merge | Excel Discussion (Misc queries) | |||
how do i convert text to date (mm/yy text to mm/dd/yyyy date)? | Excel Discussion (Misc queries) | |||
Concatenating a Text and a Date without losing orginal Date Format | Excel Discussion (Misc queries) | |||
Help: How do I convert a text date into a real date format | Excel Worksheet Functions | |||
Change text to date and check against date in cell | Excel Programming |