Adding zero's to the beginning of a number

K

kukarooza

I'm trying to enter a number into a cell and because the number I nee
to add starts with zero's, Excel automatically changes the number an
removes the zero's. For example, I'm trying to enter the number 00709
and after entering it and going to another cell, the number i
automatically changed to 7099. Is it posisble to keep the cell showin
the numbers like I need them? If so, how do I do it? Thanks
 
R

R D S

kukarooza > said:
I'm trying to enter a number into a cell and because the number I need
to add starts with zero's, Excel automatically changes the number and
removes the zero's. For example, I'm trying to enter the number 007099
and after entering it and going to another cell, the number is
automatically changed to 7099. Is it posisble to keep the cell showing
the numbers like I need them? If so, how do I do it? Thanks!

Highlight the cell(s) right click, format numbers, custom, then type
'000000' in the textbox.

HTH
Rick
 
J

jeff

Hi,

YOu can either pre-format the cells as "text" or enter
your numbers with a leading apostrophe: 07059 becomes
'07059.

jeff
 
A

alexanderd

try the following
' private sub include00
range ("A4") ' in my case
selection.numberformat="0000000" ' 7 figures in my case
selection.copy
range("A4:A6000").select
selection.pastesoecial:=xlpasteformats,operation:=xlnone, _
skipblanks:=false,transpose:=false
Range("A4").select
application.cutcopymode=false
end sub

it works for me even with a cs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top