converting string of numbers into date

spacecaptainsuperguy

Board Regular
Joined
Dec 30, 2004
Messages
173
I have a report that dumps into excel with the date in this format:

20060919

for Sept 19, 2006.

I'm trying to create a quick macro to convert this column of data into a usable date format.

I've tried a few different things but I can't seem to make excel understand that I'm trying to get a DATE format out of it.

Any ideas?

thanks in advance
SpaceCap
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
You can convert it with a simple fomula in another column

=TEXT(A1,"0000-00-00")+0

format as date
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
No need for a macro.

Highlight your range and goto Data-->Text to Columns-->Next-->Next-->Column Data Format-->Date-->YMD-->Finish.

HTH,

Smitty
 

spacecaptainsuperguy

Board Regular
Joined
Dec 30, 2004
Messages
173
Thanks a lot. those are both very easy solutions. I knew I had to be missing something easy.

I had tried the text to columns, but did not try the YMD formatting option.

thanks again.

SpaceCap
 

Forum statistics

Threads
1,141,681
Messages
5,707,795
Members
421,528
Latest member
datdude151

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