Hi, following thread68 1763485, I was able to use the Data > Text to columns to split out a DD-MMM-YY HH:MM:SS format into 2 columns, Col A for the date and Col B for the time.
This works fine if done manually, following the Fixed Width option and not importing the empty space between the data and time.
However when I recorded a macro and reran it, instead of splitting the data over 2 columns, it splits it over 3, has the date and 00:00:00 in col A, drops the hour in Col B and has AM or PM in Col C
here is my orginal display
26-Mar-16 09:26:00
26-Mar-16 13:27:18
Here is how is looks spread over 3 cells
[highlight]26-Mar-16 00:00:00[/highlight]|[highlight]:26:00[/highlight]|[highlight] AM[/highlight]
[highlight]26-Mar-16 00:00:00[/highlight]|[highlight]:27:18[/highlight]|[highlight] PM[/highlight]
This is first time that I've seen a recorded macro work differently to the effect of the manual steps on the same data.
Any ideas on what needs to change in the code to get the date and time to split over 2 columns?
This works fine if done manually, following the Fixed Width option and not importing the empty space between the data and time.
However when I recorded a macro and reran it, instead of splitting the data over 2 columns, it splits it over 3, has the date and 00:00:00 in col A, drops the hour in Col B and has AM or PM in Col C
here is my orginal display
26-Mar-16 09:26:00
26-Mar-16 13:27:18
Here is how is looks spread over 3 cells
[highlight]26-Mar-16 00:00:00[/highlight]|[highlight]:26:00[/highlight]|[highlight] AM[/highlight]
[highlight]26-Mar-16 00:00:00[/highlight]|[highlight]:27:18[/highlight]|[highlight] PM[/highlight]
Code:
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(10, 9), Array(12, 1)), TrailingMinusNumbers _
:=True
This is first time that I've seen a recorded macro work differently to the effect of the manual steps on the same data.
Any ideas on what needs to change in the code to get the date and time to split over 2 columns?