Globally define all Excel worksheets as text

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi all,

Excel stores numbers with 16-digit precision. We work
with numbers that are larger than that, so they get
truncated. The numbers come from a CSV file created by
another application, so I can't define a column as text
and then paste in the numbers.

Is there a way to globally define Excel so as to
say "treat every workbook that you open as being all text
cells...don't convert anything into numbers."

TIA
Paul
 
Typical workaround is to simply rename the csv file with a .txt extension and
then use the Import wizard and define that column as text in the wizard during
the import.
 
I have recorded this in Excel 2003.
I Think it will also work in earlier versions.

Sub AllCellsAsText()
'
' AllCellsAsText Macro
' Macro recorded 29-1-2004 by Wouter Magré
'

'
Cells.Select
Selection.NumberFormat = "@"
End Sub


It can changed into the next line of code.
So will de complet shot NOT be selected

Cells.NumberFormat = "@
 
Back
Top