Solved

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

Posted on 2011-02-12
3
202 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:
teylyn 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

746 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

10 Experts available now in Live!

Get 1:1 Help Now