View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default Automatically retain zero's when importing csv files

Do you have control of the app that makes the CSV? If so then precede the
quasi-numeric fields with a single apostrophe.
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"The Big P" <The Big wrote in message
...
I regularly have to extract data from various systems as csv which
automatically open in Excel. However, when this happens automatically
leading
zero's are lost as Excel seems to assume that data is number and not text.
I
can intervene manually and do the usual 'save as txt' or 'use import
wizard
to format cells at text' etc. However, these extracts are meant to run
without any human intervantion. Does anyone know of a way of setting Excel
to
always open formatted as text or a script that can be used within a csv
extract that would pre-format Excel? Here's hoping...