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

  • Thread starter Thread starter robpearl
  • Start date Start date
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
 
try this
Sub addnum()
For Each c In Range("c1:c2000")
c.Value = "1" & c
Next
End Sub
 
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.
 
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
 
Back
Top