• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

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

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
dmalovich
Asked:
dmalovich
1 Solution
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
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
 
patrickabCommented:
>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
 
dmalovichAuthor Commented:
Awesome. Thanks......
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now