View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob I Bob I is offline
external usenet poster
 
Posts: 2,819
Default Add Leading Zeros

Enter an Apostrophe in the Cell first or Format the cells as text BEFORE
keying in the "numbers"

Erika wrote:

I have a list of product codes, all product codes should be 9 characters. In
my list I have some product codes that are not 9 characters because the
leading zeros have been dropped. Is there a formula or format I could use
that will add back the zeros if the product number is less then 9 char. I
need it to add as many zeros as necessary to make the total characters 9.

Example
100ab - this needs 4 zeros 0000100ab
100WMVF1 - this would need 1 leading zero