Converting dd/mm/yyy hh:mm to yyyymmddhhmmss

digger2640

New Member
Joined
Sep 16, 2014
Messages
1
Hi there,

I have been searching high and low for an answer to this and I cannot find anything. :(

The situation is this:

I have a csv file that contains a date and time column. The date and time is formatted in "dd/mm/yyy hh:mm" (eg: 26/08/2014 22:11). This date is related to a the date and time a form was submitted by a user.

The macro I have been writing I can convert to entire column to format the cells as yyyymmddhhmmss to create a 'unique' number and this works fine, however even after I have converted it to look like 20140826221124 (the 24 refers to the seconds) in the actual column, it still shows as "26/08/2014 10:11:24 PM".

When I save the csv file the date and time is saved as 20140826221124. No problems so far.

However, if the csv file is opened and the macro run again, it will convert the date and time column to a long line of ##############################.

The hashes are displayed, there is no number at all.

So my question is, how can I get the converted 20140826221124 to just be a number with no reference to date and time.

Gosh I hope this makes sense. Thank any of you in advance for any assistance.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,214,789
Messages
6,121,590
Members
449,039
Latest member
Arbind kumar

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