Solved

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

Posted on 2011-02-12
3
204 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now