Solved

I'm trying to format numbers in an excel column to a date format.

Posted on 2011-02-12
3
207 Views
Last Modified: 2012-05-11
I have a column of numbers starting in cell A1 and ending in A29163.  The all have 8 numbers in the format 19000103   The first 4 numbers are the year, the next 2 are the month and the last 2 are the day.  I would like the cell to show the date format as 1900-Jan-03     Can anyone please help me automate this with a vba script to do it in one shot? Thanks
0
Comment
Question by:dmalovich
3 Comments
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst earned 500 total points
ID: 34880606
Hello,

with a formula you could use

=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

then format the result with custom format yyyy-mmm-dd

cheers, teylyn
0
 
LVL 45

Expert Comment

by:patrickab
ID: 34880616
>Can anyone please help me automate this with a vba script to do it in one shot?

It is always much faster to use Excel's built-in formulae rather than use VBA. So teylyn's solution is the best way to go.

Patrick
0
 

Author Closing Comment

by:dmalovich
ID: 34880678
Awesome. Thanks......
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question