Hello All,
I have a datasheet in form of Excel table with different columns of data where I want to convert the first column (Time) including date and time information in each cell from string format to readable date and time format using VBA.
Time
30.11.2016 14:20:44
30.11.2016 14:20:45
30.11.2016 14:20:46
30.11.2016 14:20:47
30.11.2016 14:20:48
30.11.2016 14:20:49
I can do this simply on Excel using "Text to Columns" option, and therefore I tried to record a macro out of this method which looks like this:
However, when executed, this code doesn't do the job and the cells remain in string format.
I also don't want to do the task using iterative methods since for a big set of data it can be costly. I would appreciate if you have an idea how to accomplish the task.
Regards,
I have a datasheet in form of Excel table with different columns of data where I want to convert the first column (Time) including date and time information in each cell from string format to readable date and time format using VBA.
Time
30.11.2016 14:20:44
30.11.2016 14:20:45
30.11.2016 14:20:46
30.11.2016 14:20:47
30.11.2016 14:20:48
30.11.2016 14:20:49
I can do this simply on Excel using "Text to Columns" option, and therefore I tried to record a macro out of this method which looks like this:
Code:
Sub Macro3()
Range("Table2[Time]").Select
Selection.TextToColumns Destination:=Range("A4"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
End Sub
I also don't want to do the task using iterative methods since for a big set of data it can be costly. I would appreciate if you have an idea how to accomplish the task.
Regards,