View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Disable conversion from text to number from .csv file

The combination of naming the file .csv and double-clicking the icon tells
Excel to perform conversions on the data. There are at least 4 ways to avoid
conversion:

1. name the file something.txt When opened, Excel will bring up the Import
Wizard to allow you define the column as Text

2. Place an apostrophe (single quote) in from of the value. No conversion
will be performed

3. rather than double-clicking, first open Excel and then use:

Data Import External Data Import Data...

which also brings up the Import Wizard


4. Open the file with VBA



Take your pick.
--
Gary''s Student - gsnu200789


"Steve Forest" wrote:

I need to generate a .csv file that will not have columns automatically
converted to numbers when they are in fact text. For example, I have a CUSIP
"6471989E2" which is converted to 647198900 by Excel automatically. I have
tried surrounding field in double quotes but that has no effect. Single
quotes avoid the conversion, but the quotes appear in the spreadsheet, also
undesirable.

Note: I must have a 'double-click' solution. The file must open correctly on
a double-click without any user intervention or special importing.
For example, is there a non-printable escape character that can be added to
the field that would tell Excel that it must treat the field as text?

Thanks,
--
Steve Forest