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
|