D
Dagonini
I did a search on this site and found a macro to convert a number to a
date. So i tried to update it to match my situation. However, I get a
runtime error 13 type mismatch.
I have a column of birthdates that come across as 20050102 and I need
it to read 01/02/2005. This is the macro:
Sub makedate()
Dim NewDate As Date
Dim cell As Range, sStr As String
Set cell = Range("a:a")
NewDate = CDate(Mid(cell, 3, 2) & "/" & Left(cell, 2) & "/" &
Right(cell, 2))
sStr = Format(NewDate, "dd/mm/yyyy")
End Sub
This is the line that is giving the run time error: NewDate =
CDate(Mid(cell, 3, 2) & "/" & Left(cell, 2) & "/" & Right(cell, 2))
Does anyone have an idea of why?
date. So i tried to update it to match my situation. However, I get a
runtime error 13 type mismatch.
I have a column of birthdates that come across as 20050102 and I need
it to read 01/02/2005. This is the macro:
Sub makedate()
Dim NewDate As Date
Dim cell As Range, sStr As String
Set cell = Range("a:a")
NewDate = CDate(Mid(cell, 3, 2) & "/" & Left(cell, 2) & "/" &
Right(cell, 2))
sStr = Format(NewDate, "dd/mm/yyyy")
End Sub
This is the line that is giving the run time error: NewDate =
CDate(Mid(cell, 3, 2) & "/" & Left(cell, 2) & "/" & Right(cell, 2))
Does anyone have an idea of why?