davidmg1982
Board Regular
- Joined
- Oct 12, 2015
- Messages
- 64
Im having troubles to convert a text column into dates, but so far my script is just giving me back some crazy numbers only. Thanks ahead for your guidance.
This is how my data looks like:
This is what i want in return, along with the date format in the column
Sub FormatDate()
With ActiveSheet.UsedRange.Columns("DO").Cells
.TextToColumns Destination:=.Cells(1), DataType:=xlFixedWidth, FieldInfo:=Array(0, xlYMDFormat)
.NumberFormat = "mm/dd/yyyy"
End Sub
This is how my data looks like:
01312020 |
02292020 |
03312020 |
04302020 |
05312020 |
This is what i want in return, along with the date format in the column
01/31/2020 |
02/29/2020 |
03/31/2020 |
04/30/2020 |
05/31/2020 |
Sub FormatDate()
With ActiveSheet.UsedRange.Columns("DO").Cells
.TextToColumns Destination:=.Cells(1), DataType:=xlFixedWidth, FieldInfo:=Array(0, xlYMDFormat)
.NumberFormat = "mm/dd/yyyy"
End Sub