Converting text to date

Ammarhm

Beginner User
Local time
Today, 13:46
Joined
Jul 3, 2008
Messages
80
Hi!
I am importing data from a text file, some of the imported data are dares, written in the following format:
12mar2009

The problem is that the data is stored as text and not as date type of data, which makes it difficult to do mathematical procedures on that type of data
is there a function/way to convert that to "real" date data?
Regards
 
Hi again
Came up with this solution, I dont know if anyone can suggest something else?

Sub convert()

Dim LDate As Date
Dim Str As String
Dim LD As String


LD = "04jul2006"
Str = Left(LD, 2) & " " & Mid(LD, 3, 3) & " " & Right(LD, 4)

LDate = CDate(Str)


End Sub



Best Regards
 

Users who are viewing this thread

Back
Top Bottom