ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TextDate ??? (https://www.excelbanter.com/excel-programming/428091-text-date.html)

silentpro

TextDate ???
 
I have a workbook that has multiple sheets & each one has a date field.
Someone entered the dates in a non xl date format

Example: January 6 2009

I tried formatting the whole column to show d/m/yy but the text example
above doesn't format.

Is there a macro or something that I can run to convert these text dates to
an actual date format?


Thanks


Rick Rothstein

TextDate ???
 
I think this macro will do what you want (just change the sheet name and
cell range in the For Each statement to match your actual conditions)...

Sub MakeNearDatesRealDates()
Dim C As Range
For Each C In Worksheets("Sheet1").Range("C:C")
If TypeName(C.Value) < "Date" Then
If IsDate(C.Value) Then C.Value = CDate(C.Value)
End If
Next
End Sub

--
Rick (MVP - Excel)


"silentpro" wrote in message
...
I have a workbook that has multiple sheets & each one has a date field.
Someone entered the dates in a non xl date format

Example: January 6 2009

I tried formatting the whole column to show d/m/yy but the text example
above doesn't format.

Is there a macro or something that I can run to convert these text dates
to an actual date format?


Thanks



silentpro

TextDate ???
 
Perfect, thank you very much!!!!


"Rick Rothstein" wrote in message
...
I think this macro will do what you want (just change the sheet name and
cell range in the For Each statement to match your actual conditions)...

Sub MakeNearDatesRealDates()
Dim C As Range
For Each C In Worksheets("Sheet1").Range("C:C")
If TypeName(C.Value) < "Date" Then
If IsDate(C.Value) Then C.Value = CDate(C.Value)
End If
Next
End Sub

--
Rick (MVP - Excel)


"silentpro" wrote in message
...
I have a workbook that has multiple sheets & each one has a date field.
Someone entered the dates in a non xl date format

Example: January 6 2009

I tried formatting the whole column to show d/m/yy but the text example
above doesn't format.

Is there a macro or something that I can run to convert these text dates
to an actual date format?


Thanks




All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com