View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Laurence Lombard Laurence Lombard is offline
external usenet poster
 
Posts: 24
Default Convert a yyyymmdd date format in code

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
VBA?
Thanks
Laurence