ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Globally define all Excel worksheets as text (https://www.excelbanter.com/excel-programming/289641-globally-define-all-excel-worksheets-text.html)

Paul

Globally define all Excel worksheets as text
 
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



Ken Wright

Globally define all Excel worksheets as text
 
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.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"Paul" wrote in message
...
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




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004



whm

Globally define all Excel worksheets as text
 
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 = "@

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 04:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com