Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default get actual date from variable text string

Richard,
Excel will generally accept date in many formats, with a suitable separator.
As Jon pointed out, 113006 would be a problem as it appears to be just a
number (or text).
However, you will have trouble with dates where the day is not unambiguous
e.g. <13.

For this, you will have to process it yourself (Left,Mid,Right) and
DateSerial.
If you cannot tell if say 12/10/2007 falls in December or October, Jon's
Option 2 is the solution.

If possible, provide the user with a UI (possibly with a calendar control)
to ensure consistent date/data entry and avoid this mess.

NickHK

"Richard" wrote in message
...
I'm importing dates that are from a text field filled in by numerous

people,
so it could be in a host of formats.
e.g. 30-Nov-06 or 113006 or 11/30/2006 or November 30th, 2006.

How can I convert to true Excel Date format?

(I realize there may be no macro that gets it right all the time.)
--
Richard



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
Text strings from a variable string Ferdy New Users to Excel 1 October 26th 09 07:41 PM
find a variable text string [email protected] Excel Discussion (Misc queries) 2 January 30th 07 07:20 PM
get actual date from variable text string Jon Peltier Excel Programming 0 December 19th 06 03:12 PM
Getting text file into a VBA string variable Don Wiss Excel Programming 10 January 7th 05 12:42 AM
& reference answering as Date Serial # not actual text Kevin M Excel Worksheet Functions 0 November 30th 04 05:57 PM


All times are GMT +1. The time now is 02:03 AM.

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"