Extracting Part of a Date
Maybe this might help (extracted from VBA Help:
Left Function Example
This example uses the Left function to return a specified number of
characters from the left side of a string.
Dim AnyString, MyStr
AnyString = "Hello World" ' Define string.
MyStr = Left(AnyString, 1) ' Returns "H".
MyStr = Left(AnyString, 7) ' Returns "Hello W".
MyStr = Left(AnyString, 20) ' Returns "Hello World".
Regards,
Jan BArt
"GLT" wrote:
Hi,
I have a variable in VBA called myDate and I need to extract the fist two
letter of the day, from the date which is stored in myDate.
For example, if myDate = Tuesday, July 3 2007, then I need to put 'TU' into
variable of myDay.
Can anyone help?
Thanks.
|