+ Reply to Thread
Results 1 to 4 of 4

Leading zeroes - cell shows it, value does not

  1. #1
    Registered User
    Join Date
    01-24-2008
    Posts
    2

    Leading zeroes - cell shows it, value does not

    Okay here is the problem. I am working with UPC codes, many of which have a leading zero. Excel is formatting them as numbers, and while I can play with the formatting to make the zero appear, in the formula bar the value is still shown without the zero. Since this is a UPC code it shouldn't even be treated as a number, but as text; however changing the format to text immediately removes the leading zero. The same thing happens if I use "Text to Columns" - it removes the leading zero because the actual value has removed it, just it's being formatted to display one. I need the value to have the leading zero, not the cell.

    There are some 25,000 items here. Is there *any* way to change the *value* to text AND keep the leading zero? This data is to be imported into SQL Server so it needs to be text, but just changing the format still removes the leading zero, which will make the data invalid.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Does this work for you with your numbers in column A and this in B1 copied down?

    ="0"&A1
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You can handle them as text throughout. Even when doing text to columns, you have the option of maintaining text format in the last dialog.

  4. #4
    Registered User
    Join Date
    07-21-2008
    Location
    Canada
    Posts
    3
    type ' before the codes you are entering - it should keep leading zeros.

+ 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. Macro to copy cell comments to a new cell?
    By MyBrainhURTS in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-04-2009, 11:20 AM
  2. Add First Cell Data to Last Nth Cell Where Nth Last_Cell_Value>0
    By DaedalusXF in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-08-2008, 07:48 PM
  3. remove leading space in cell?
    By djarcadian in forum Excel General
    Replies: 2
    Last Post: 04-01-2008, 02:55 PM
  4. read cell content and use with Hyperlinks.Add Cell
    By apoc [t.i.m.] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2007, 10:02 AM
  5. Dates being accepted in an accounting cell
    By andy clegg in forum Excel General
    Replies: 1
    Last Post: 11-14-2006, 09:56 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