+ Reply to Thread
Results 1 to 3 of 3

padding ?

  1. #1
    vbastarter
    Guest

    padding ?

    I have a columnn with id numbers
    ex:
    012
    456788
    78
    .... etc
    I would like the final Id to be 10 digits so i would like to pad 0's in the
    front eg:
    012 -> has to become 0000000012
    456788 -> hast to become 0000456788

    Is there a function in excel that can achieve this for teh entire column ?

    Many Thanks

  2. #2
    Dave Peterson
    Guest

    Re: padding ?

    You can change the number format to "0000000000" (without the quotes) and the
    cells will display all those leasing 0's.

    Select the column
    format|cells|number tab
    custom category
    type in that long string of 0's
    hit ok.

    vbastarter wrote:
    >
    > I have a columnn with id numbers
    > ex:
    > 012
    > 456788
    > 78
    > ... etc
    > I would like the final Id to be 10 digits so i would like to pad 0's in the
    > front eg:
    > 012 -> has to become 0000000012
    > 456788 -> hast to become 0000456788
    >
    > Is there a function in excel that can achieve this for teh entire column ?
    >
    > Many Thanks


    --

    Dave Peterson

  3. #3
    Forum Contributor
    Join Date
    12-02-2004
    Location
    London
    Posts
    255
    You have two options depending on what you are trying to achieve. If you want the data to be held with the leading zeros then format the column as text and put a data validation on the cells requesting a text length of 10 characters.

    If you are not bothered with what is actually in the cell, you just want it to display with 10 numbers, then use a custom formt of 0000000000. This will then display the number 123 as 0000000123

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1