Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Pasting Leading Zeroes.

Pasting Leading Zeroes

Written by Allen Wyatt (last updated November 14, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


1

Some data requires leading zeroes. The first example that comes to mind is ZIP Codes, in which some have leading zeroes. There are other examples, as well. For instance, you may have a chart of accounts in which general ledger account numbers start with leading zeroes.

When you paste information into Excel, it normally tries to "parse" the data and put it in a format that it can work with. When you paste data that have leading zeroes, and the data could reasonably be construed as numbers, then Excel strips the leading zeroes from what you are pasting. For instance, 0012387 become a number value, 12387.

What if you want to retain the leading zeroes? All you need to do is make sure that the target cells—the ones that will receive the data being pasted—are formatted as text. Follow these steps:

  1. Select the cells that will hold the data you are going to paste.
  2. Choose the Cells option from the Format menu. Excel displays the Format Cells dialog box.
  3. Make sure the Number tab is selected. (See Figure 1.)
  4. Figure 1. The Number tab of the Format Cells dialog box.

  5. In the Category list, choose Text.
  6. Click on OK.

Whatever you now paste into the formatted cells is assumed to be text, and Excel will leave your leading zeroes exactly as you expect them.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2752) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Pasting Leading Zeroes.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Personal.xls File Not Opening

The Personal.xls workbook is used primarily to store macros that you want available through all of your workbooks. ...

Discover More

Clearing the Print Area

Excel allows you to specify which portions of a worksheet should be printed when you send output to your printer. If you ...

Discover More

A Shortcut for Switching Focus

While not technically an Excel-only tip, the shortcuts described in this tip will help you switch focus from your ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (menu)

Filtering Columns for Unique Values

Given a long list of names, part numbers, or what-have-you, you may need to determine the unique values within the list. ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

2021-07-15 09:57:49

Bri

Thank you!! Very straight forward and to the point.


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.