PDA

View Full Version : Solved: Changing Date Format in an Array



mferrisi
04-04-2007, 06:01 AM
I created an array that pushes back dates from an excel worksheet. They come into the Array in "mmm-yy", I would like to change them to "YYYY" format.

For efgh = 2 To abcd
Arr(efgh) = Range(Cells(efgh, 5), Cells(efgh, 5)).Value

????????????

Next efgh

Bob Phillips
04-04-2007, 06:21 AM
Just format the results cells to YYYY

mferrisi
04-04-2007, 06:42 AM
Is there a way to do it inside the array? I would rather not change the cells, since I would have to change them back again....

Thanks

Bob Phillips
04-04-2007, 07:00 AM
You would have to load them formatted one by one.

mferrisi
04-04-2007, 07:10 AM
That's fine. So long as the cells are not altered. What woudl that look like?

Thanks,

Matt

Bob Phillips
04-04-2007, 09:11 AM
For efgh = 2 To abcd
Arr(efgh) = Format(Cells(efgh, 5).Value,"yyyy")
Next efgh