Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
date formatting
Hi ,
I got a string like "20030101" and I want this to become the date 01 jan 03 . I can't figure it out. Can you please help if this action is possible Cheers, Douvid |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
date formatting
One way:
Select your date string(s). Choose Data/Text to Columns. Click Next, Next. Select YMD in the date dropdown. Click Finish. Format as a date. Note: Your example is ambigouous, so you may need to use YDM instead. In article , douvid wrote: Hi , I got a string like "20030101" and I want this to become the date 01 jan 03 . I can't figure it out. Can you please help if this action is possible |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
date formatting
ok but I'm want to do all that from vba. through coding
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
date formatting
Turn on the macro recorder and do it manually. (for Text to columns)
If you are talking about parsing a string (assuming string is yyyymmdd) Dim dt as Date Dim sStr as String sStr = "20030101" dt = DateValue(Mid(sStr,5,2) & "/" & mid(sStr,7,2) & "/" & Left(sStr,4)) Demo'd from the immediate window: sStr = "20030101" ? DateValue(Mid(sStr,5,2) & "/" & mid(sStr,7,2) & "/" & Left(sStr,4)) 1/1/03 -- Regards, Tom Ogilvy douvid wrote in message ... ok but I'm want to do all that from vba. through coding |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
Date Formatting | Excel Discussion (Misc queries) | |||
Date Formatting | Excel Discussion (Misc queries) | |||
Date Formatting | Excel Discussion (Misc queries) | |||
date formatting | Excel Discussion (Misc queries) |