Date 'Unformatting' Issue

RunTime91
07-09-2010, 01:39 AM
Greetings all,

I am working with data that is formatted as such: 1-10-50 or 3-15-50, etc.; naturally, excel turns this into 1/10/1950 or 3/15/1950, etc. Is there some code that can help me turn this back to the original formatting. (btw, setting the cell to text does not work).

The finished cell content needs to be:

1-10
3-15

These are not dates as excel would like to think.

I am currently working with a rather verbose loop 'text to columns' code and I am looking for something that will work a little faster.

Thanks in advance for all your help

Bob Phillips
07-09-2010, 04:42 AM
Doesn't setting the cell format to dd-mm-yy work for you?

RunTime91
07-09-2010, 08:11 AM
Doesn't setting the cell format to dd-mm-yy work for you?

Bob,

Thank you for responding...

Please accept my apology, I ommitted part of my post, which I have now edited. The goal here is to remove the '/1950' and simply end up with 1-10, 3-15, etc, but not formatted as dates, as the original data are not dates.

Thanks again

-RT91

Bob Phillips
07-09-2010, 08:19 AM
Use a formula

=TEXT(A2,"d-mm")

RunTime91
07-09-2010, 09:10 AM
Bob, you are a genius!

For the sake of other posters I changed your formula to =TEXT(A2,"m-dd") and it worked as you knew it would...Thank You, Very Much!!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum