View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Cells drop leading zeros from numbers

SQLUser formulated on Sunday :
Is there a way to have a cell default to a text format without having
the spreadsheet already open?
The reason is that numbers that have a leading zeros are removed when
data is placed into the spreadsheet becuse the cell format is set to
General.

I have an application that will place a report into Excel when the
Excel icon is selected.


Thanks in Advance,

Mike


Use a custom format for cells to receive leading zeros. For example, to
display an 8 digit part number with leading zeros...

In the Custom format box type:
0000000#

Now, if you enter 27 in the cell, Excel displays it as 00000027.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc