Importing text columns in csv file

  • Thread starter Thread starter Kelvin Smith
  • Start date Start date
K

Kelvin Smith

Is there any way to force Excel to treat a column of data
in a .csv file as text, rather than as "general"? I have a
column of numbers for which I need to keep the leading
zeroes (zip codes), and standard behavior opening a .csv
file treats the value as a number and strips the zeroes.
I'm using a macro, but using FieldInfo:=Array(Array(1, 2))
as a qualifier on Workbooks.OpenText doesn't seem to have
any effect on a .csv file, though it works fine for a .prn
or .txt file.

Is my only choice to rename the file? I guess I can do
that inside the macro, but it seems a very inconvenient
way to get a very basic operation done.
 
Before the data is moved you should format the cells as text:
Main Menu Format-->Cells-->"Number" Tab Select "Text"

You may need to paste using a right click and "Paste Special"/"Values"

-Piku
 
Sorry, this doesn't help. I'm not copying and pasting; I'm
pulling the information in from a .csv text file.

Kelvin Smith
 
Back
Top