+ Reply to Thread
Results 1 to 2 of 2

Add leading zero's

  1. #1
    Forum Contributor
    Join Date
    06-20-2007
    Location
    Buckeye, AZ
    MS-Off Ver
    365
    Posts
    272

    Add leading zero's

    I have a workbook with a column of numbers varying from 3 digits to 6 digits. I need to add leading zeros so all numbers contain 6 digits. Is this possible? I've attached a simple example. Any suggestions would be appreciated.
    Sick
    Attached Files Attached Files
    Last edited by sick stigma; 04-20-2021 at 05:17 PM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,844

    Re: Add leading zero's

    The main question I see is whether these need to be numbers or text -- how will these numbers be used?

    If they need to be numbers, but displayed with leading zeroes, simply format with a number format code like "000000". Remember that the actual cell value is the number (A1 will still be 654), but you will see the leading zeroes in the cell display.

    If they need to be text (so the actual cell value is "000654", then you will need to enter the numbers as text (preformat the cell as text or precede the data entry with an apostrophe) or you will need to convert them to text after data entry (something like =TEXT(A1,"000000")).

    You will need to know enough about how you intend to use these numbers or how you intend to interact with them in order to decide which approach you want to use.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Keep leading zero in vba
    By Jonybear in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2020, 09:11 AM
  2. [SOLVED] VBA to add leading zero.
    By mowens74 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-13-2020, 11:01 AM
  3. Help with leading 0's
    By pleasir in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-07-2017, 07:18 PM
  4. leading Zero
    By mma3824 in forum Excel General
    Replies: 2
    Last Post: 10-31-2012, 11:45 AM
  5. Leading zero
    By rofl in forum Excel General
    Replies: 4
    Last Post: 01-24-2010, 04:07 PM
  6. Leading Zero
    By zachharriman in forum Excel General
    Replies: 7
    Last Post: 05-03-2008, 04:21 AM
  7. [SOLVED] leading zero
    By IRA in forum Excel General
    Replies: 1
    Last Post: 10-26-2005, 02:05 PM

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