Add 0 to the beginning of the cell

B

bklim

Dear Excel experts

12345 -> 0000012345
12 -> 0000000012
432567 -> 0000432567
9 -> 0000000009
4444444444 > 4444444444

The 1st column shows the original figures. I wish to add "0" to the
beginning of the cell to make the total number of digit becomes 10,
what would be the formula? Please advise.

Thank you in advance.

Regards/Mike
 
M

mangesh_yadav

Select cell.
Format > Cells > Number tab > Select custom > In type enter 0000000000

Mangesh
 
A

Arvi Laanemets

To convert numbers to text strings with leading 0's, use the formula like
=TEXT($A2,"0000000000")
 
T

Toppers

Hi,
Set cell(s) format as shown below:

NumberFormat = "0000000000"

e.g.

Columns("A:A").Select
Selection.NumberFormat = "0000000000"

Or go to Format-->Cells--->Custom-->Type and enter"0000000000" (without
quotes)


HTH
 
K

K Dales

If you only need to display it (format it) that way, then in the cell format
choose Custom and make the custom format 0000000000.

If you actually need to convert the value;
=Right("0000000000"&A1,10) - worksheet formula
=Right("0000000000"&MyVar) - VBA, where MyVar is the variable with the
original figure in it.
 

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