I have dates in Col L in format dd/mm/yyyy
I have tries to write code to remove the time and where the first two numbers in the date for eg 09 is less than 10, to convert those date to mm/dd/yyy for eg 09/05/2017 must change to 05/09/2017 , 14/08/2017 must remain as is etc
it would be appreciated if someone could kindly amend my code
I have tries to write code to remove the time and where the first two numbers in the date for eg 09 is less than 10, to convert those date to mm/dd/yyy for eg 09/05/2017 must change to 05/09/2017 , 14/08/2017 must remain as is etc
Code:
Sub Convert_Dates()
With Sheets("Imported Data")
With .Range("L2:L" & .Cells(Rows.Count, "L").End(xlUp).Row)
.TextToColumns Destination:=.Cells(1), _
DataType:=1, TextQualifier:=1, _
ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, _
Space:=False, Other:=False, FieldInfo:=Array(1, 4), _
TrailingMinusNumbers:=True
End With
End With
End Sub
it would be appreciated if someone could kindly amend my code
Book1 | |||
---|---|---|---|
L | |||
1 | Date Processed | ||
2 | 14/08/2017 00:00:00 | ||
3 | 18/08/2017 00:00:00 | ||
4 | 30/08/2017 00:00:00 | ||
5 | 30/08/2017 00:00:00 | ||
6 | 09/05/2017 00:00 | ||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
Imported Data |
Last edited: