Convert a yyyymmdd date format in code
Am Fri, 6 May 2011 08:50:33 +0200 schrieb Laurence Lombard:
How does one in VBA code convert a date with format yyyymmdd (eg today's
date = 20110505) to a date recognized by Excel. I tried ConvertedDate =
Application.Worksheetfunction.Date(Left(InputDate, 4),Mid(Inputdate,5,2),Right(InputDate,2))
but that does not work. It would be easy enough in the spreadsheet, but in
ConvertedDate =DateSerial(Left(Inputdate, 4), Mid(Inputdate, 5, 2), Right(Inputdate, 2))
Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
|