Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
GLT
 
Posts: n/a
Default Extracting Part of a Date

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Excelerate-nl
 
Posts: n/a
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Kleev
 
Posts: n/a
Default Extracting Part of a Date

I did the following from the Immediate Pane:

mydate = now()
? mydate
11/22/2005 3:59:29 PM
mydate = ucase(left(weekdayname(weekday(mydate)),2))
? mydate
TU


"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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
Can a date be used for conditional formatting? Stevie P Excel Worksheet Functions 2 September 27th 05 09:42 PM
Formula for Extracting Month out of a Date column PokerZan Excel Discussion (Misc queries) 3 June 10th 05 08:30 PM
Date Math Problem Dkline Excel Worksheet Functions 4 March 4th 05 04:11 PM


All times are GMT +1. The time now is 11:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"