View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Niek Otten Niek Otten is offline
external usenet poster
 
Posts: 3,440
Default Padding a text column with leading zeros

If the fixed length has to be 10:

=REPT("0",10-LEN(A1))&A1

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Chris" wrote in message ...
|I have a text file with a column containing numeric codes. I need to 'pad'
| the code values with leading zeros--so that all of the codes are of the same
| length. I imported the file into a new workbook, specifying the code column
| to be of type text.
|
| I've tried every method and searched the web and newsgroups every way, but
| can't figure out how to pad the column. The many references for Excel 2003
| don't seem to apply to Excel 2007. Can someone help?