How do I insert a single number down an entire column?

R

robpearl

PLEASE HELP!?

I have a column that is 2000 cells tall each containing numeric fou
and five digit codes. I need all the four digit codes to receive a '0
in the front to make it five digits. How can I insert the '0' befor
each of the four digit codes all the way down my column?

Thank you in advance to anyone who knows the answer to my sad, sad
question.

Rob
 
D

Don Guillett

try this
Sub addnum()
For Each c In Range("c1:c2000")
c.Value = "1" & c
Next
End Sub
 
K

Ken Wright

Would simple formatting do what you want, or do you physically need the extra
character. If you select the entire range and format as number / custom /
"00000" then all numbers will appear as 5 digits in length.
 
C

CLR

Assuming your data is in column A, Format column B as TEXT and in B1 put
this formula and copy it down your 2000 lines............

IF(LEN(A1)=4,0&A1,A1

Vaya con Dios,
Chuck, CABGx3
 

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