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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,714
Messages
5,833,276
Members
430,201
Latest member
Deepakpilla36

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
Top