asddsa88
02-27-2010, 08:02 AM
Hello, I have an excel spreadsheet that I need to import into another...
when I import the data, both the numbers (with decimals) and dates (stored in the format 01-01-2007 for example) GET STORED AS TEXT.
The "number stored as text" problem is very common and I solved it in this way: ActiveSheet.Range("f2", ActiveSheet.Range("f2").End(xlDown)).Select
Dim cell As Range
For Each cell In Selection
If Not IsEmpty(cell) And IsNumeric(cell.Value) Then
cell.Value = CDbl(cell.Value)
End If
Next cell
now I need to convert the dates stored as general text into a date format.
Note: right clicking on the dates and setting the date format doesn't work, only thing that works is double clicking on a single cell and the date magically becomes 01/01/2007 format which is what I want..
now I need a macro that does this job for me...
help appreciated!!
when I import the data, both the numbers (with decimals) and dates (stored in the format 01-01-2007 for example) GET STORED AS TEXT.
The "number stored as text" problem is very common and I solved it in this way: ActiveSheet.Range("f2", ActiveSheet.Range("f2").End(xlDown)).Select
Dim cell As Range
For Each cell In Selection
If Not IsEmpty(cell) And IsNumeric(cell.Value) Then
cell.Value = CDbl(cell.Value)
End If
Next cell
now I need to convert the dates stored as general text into a date format.
Note: right clicking on the dates and setting the date format doesn't work, only thing that works is double clicking on a single cell and the date magically becomes 01/01/2007 format which is what I want..
now I need a macro that does this job for me...
help appreciated!!