Sorry, not buying your answer. Bottom line is that there are a wide variety of data types which are NOT text but which Excel will convert to text under a number of circumstances regardless of how users ACTUALLY want their data to be handled. While pre-formatting
cells, typing additional apostrophes, or using the import wizard may work in some instances, this in no way affects the text to column issue: I formatted all cells in my workbook as text, performed text to columns on delimited data, and excel converted the
CAS number for potassium (7440-09-7) into a date (September 7, 7440). Hands up everyone who regularly uses dates over 5,000 years in the future!!!!!
Sure I can use find/replace to add an apostrophe after each of my delimiters, but this doesn't work well either. Sure, excel doesn't reformat the CAS number to a date, but the apostrophe shows up in the cell because "7440-09-7" does not look like a number
to excel (I get "'7440-09-7"). I then format the cell as "text", and use find/replace to remove the apostrophes: guess what happens? Yup, you got it; excel CHANGES the format of the cell to "date" and I'm left with "9/7/7440". Sure, I can manually delete
the apostrophe, but that's pretty tiresome if I'm dealing with a few thousand cells. The only "automatic" way to do this that I've found is to:
- add a junk character (such as an apostrophe) following each delimiter to prevent Excel from converting to a date
- run text to columns
- use "=RIGHT(B1,LEN(B1)-1)" to remove the junk character
- insert a new column and format that column as text
- paste the output of the RIGHT function as values.
Sure, more often than not I DO want Excel to autoformat dates (it's handy to be able to type "1/1/05" rather than "January 1, 2005" or the numeric equivalent "38353"). However, there are DEFINITELY times when this sort of behavior is NOT appropriate.
And personally I feel that the the find/replace function (and the text-to-columns function for that matter) changing a user-specified cell format IS a bug.
It's also sad that this thread has been going on for almost four years now.