+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    06-10-2009
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2007
    Posts
    3

    Retain Leading Zeros

    Hello Everybody.

    I am using Excel 2007

    I know my way around Excel relatively well, but I can not figure this out for the life of me.

    At the company I work for, I had to extract this massive list of parts (all beginning with one or more zeros) and excel stripped all of the zeros off preceeding the core of the part number.

    How can I get them to come back?

    This is definitely an excel issue, because DataFlo (The outdated software my company uses) shows all the zeros when the parts are exported.

    I believe i just have to format the cells that the part numbers are in and we should be golden.

    Somebody please give me a hand

    Thanks,
    Bill
    Last edited by BBretschneider08; 06-10-2009 at 05:46 PM. Reason: Admin Complaint.

  2. #2
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Re: Why do you keep removing my zeros!!!!!!

    Fortunately this may come fairly easy for you:
    1. Simply select the cells you want formatted with preceeding zero's
    2. Right-click on your selection and goto "Format Cells..."
    3. In the "Number" tab, under "Category:" click "Custom"
    4. Under "Type:" is a text box, in it, type in the number of 0's corresponding to the length of the largest part number
      • (i.e. If the largest part number--in length--were 00001234 then type in eight 0's or 00000000)
    5. Click OK
    I hope that helps!
    starryknight64

  3. #3
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,131

    Re: Why do you keep removing my zeros!!!!!!

    Welcome to the forum, BBretschneider.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    06-10-2009
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Why do you keep removing my zeros!!!!!!

    Thank you for the humble welcome!

    Sadly, I already tried doing that. It appears to have changed the numbers and add zero's in front of them, but really it just looks that way. After changing the numbers, and adding zeros as you said, i clicked the formula bar, and there still aren't zeros in there. On the spreadsheet itself, it looks as if there are zero's there, but they aren't in the formula bar.

    I need them in the formula bar, so i can use the VLOOKUP function.

    Thanks for your help,

    Bill

  5. #5
    Registered User
    Join Date
    10-31-2008
    Location
    Philippines
    Posts
    47

    Re: Why do you keep removing my zeros!!!!!!

    Try to format the cells into "Text" before pasting the data

  6. #6
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Re: Why do you keep removing my zeros!!!!!!

    emanon is right, try that out.

    You may have to copy/paste the whole spreadsheet though. If this is a problem, let me know and I could probably cook up a quick little macro to manually add in those zero's.
    starryknight64

  7. #7
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,131

    Re: Why do you keep removing my zeros!!!!!!

    BBretschneider08,

    Please change your thread title as requested.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    06-10-2009
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Why do you keep removing my zeros!!!!!!

    I can't believe that I didn't think of that.

    I am going to have to repopulate my entire spreadsheet, but I may as well do it the right way, because I really dont want to keep doing it the wrong way..

    Thank you so much

    Regards,
    Bill

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0