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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,986
Messages
6,122,611
Members
449,090
Latest member
vivek chauhan

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