Split combined date and time cell to two separate cells and format accordingly vba?

robdav

New Member
Joined
Dec 1, 2017
Messages
15
Hi

I have a report which exports the date and time in one cell (column A). I would like to be able to split these via a macro into two cells and then change the date value so it is recognised as a date. Currently the date is delimited by dots and not recognised by Excel.

I would like the date to remain in column A with a newly inserted column B containing the time (there is existing data in column B).

The existing data looks like below with Date & Time in column A and Record ID in column B.

I have hopefully shared a link to some sample data.

Any help would be appreciated.

Thanks

Rob

[TABLE="width: 208"]
<tbody>[TR]
[TD]Date & Time[/TD]
[TD]Record ID[/TD]
[/TR]
[TR]
[TD]2019.02.04 11:36:34[/TD]
[TD]11048383[/TD]
[/TR]
[TR]
[TD]2019.02.07 11:34:11[/TD]
[TD]11214207[/TD]
[/TR]
[TR]
[TD]2019.02.07 11:40:42[/TD]
[TD]11214748[/TD]
[/TR]
[TR]
[TD]2019.02.07 11:40:43[/TD]
[TD]11214749[/TD]
[/TR]
[TR]
[TD]2019.02.07 11:44:59[/TD]
[TD]11215079[/TD]
[/TR]
</tbody>[/TABLE]

https://drive.google.com/file/d/1-_Rx0JLW1mH6ILupMSmo1yCpk-58nwou/view?usp=sharing
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top