maverickmonster
Programmer
Hi
I have some date data that is stored backwards and am correcting it as part of a process.
I have written something (below) which should do this.
The current date is held as "19860317" under the general format. I can not format in excel as a date.
When i run the program it seams to work for the majority of data as when i look at it in the unformatted output sheet in excel some of the dates are unformatted excel numbers e.g 34530 but others are as text "14/09/1987"
The only thing i can see is that the ones that are formated as text are the dates with the dDay over 12 ?
I have some date data that is stored backwards and am correcting it as part of a process.
I have written something (below) which should do this.
The current date is held as "19860317" under the general format. I can not format in excel as a date.
When i run the program it seams to work for the majority of data as when i look at it in the unformatted output sheet in excel some of the dates are unformatted excel numbers e.g 34530 but others are as text "14/09/1987"
The only thing i can see is that the ones that are formated as text are the dates with the dDay over 12 ?
Code:
textyear = Worksheets("Screen 7 data").Cells(x, 6)
dYear = Left(textyear, 4)
dDay = Right(textyear, 2)
dMonth = Left(Right(textyear, 4), 2)
Worksheets("Screen 7 results").Cells(x, 6) = dDay & "/" & dMonth & "/" & dYear