Sub Test()
strdate = "051228"
MsgBox DateSerial(Left(strdate, 2), Mid(strdate, 3, 2), Right(strdate, 2))
End Sub
Sub test()
Dim strDate As String
Dim MyDate As Date
'---------------------------
strDate = "051228"
MyDate = DateSerial(2000 + CInt(Left(strDate, 2)), _
CInt(Mid(strDate, 3, 2)), CInt(Right(strDate, 2)))
Range("A1").Value = MyDate
MsgBox (Format(MyDate, "yyyy-mm-dd"))
End Sub