+ Reply to Thread
Results 1 to 11 of 11

Formatting Number as text Issue.

  1. #1
    Registered User
    Join Date
    02-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Formatting Number as text Issue.

    I am having some problems getting numbers to stay formatted as text and be displayed correctly.

    We price products using a pricing tool which exports the results to Excel.
    The file is then saved to .xls format; Workbook Attached


    When opening these files for editing, we are seeing the barcode numbers as;
    7.43216E+11 So we change to Cell Format to Text, but the displayed numbers do not change. The numbers do show in the function bar as digits, but not in the cell.

    The only way I can have them display as digits is by formatting to Fraction?! Which seems odd, but then we loose any that start with one or two Zeroes so we’re ending up with 11 or 12 digit numbers when all of the barcode numbers will be 12 or 13 digits long.

    Can anyone help or advise?
    Opening in Excel 2010. Files exported to, and saved as xls in Excel 2002. (Compatibility mode problem?)

    Thanks in advance for any assistance
    Attached Files Attached Files
    Last edited by DunkUK101; 02-12-2013 at 06:25 AM.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Formatting Number as text Issue.

    I haven't tested this but I have problems with barcodes if the number doesn't have a single quote at the beginning...it tells excel to force it to text...

    hope this helps

    Ernest

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Formatting Number as text Issue.

    Insert this in a module for your workbook:

    Please Login or Register  to view this content.
    Select the column of numbers, and run the Add_Apostrophe script.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Formatting Number as text Issue.

    Some of your numbers (e.g. in A12, A19, A21 etc.) are 13 digits long, so how many digits should you have?

    If you want to make them up to 13 digits, then you could have this formula in E5:

    =REPT("0",13-LEN(A5))&A5

    and copy down. You could then fix those values, and then copy/paste them into column A to over-write the ones that are there, and then delete column E.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    02-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formatting Number as text Issue.

    Quote Originally Posted by ConneXionLost View Post
    Insert this in a module for your workbook:

    Please Login or Register  to view this content.
    Select the column of numbers, and run the Add_Apostrophe script.
    Thank you Connexion, sorry but my expertise with Excel is limited, How do I go about adding that code to the workbook?

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,608

    Re: Formatting Number as text Issue.

    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button

  7. #7
    Registered User
    Join Date
    02-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formatting Number as text Issue.

    Quote Originally Posted by Pepe Le Mokko View Post
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button
    The Alt+F11 Shortcut to VB Editor not working for me in 2010, it is in 2003. I have the developer tools in the ribbon visible. Do I enter VBA code via that?

  8. #8
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Formatting Number as text Issue.

    Hi DunkUK101

    Developer tab, left hand side, Visual Basic that will bring up the VBE. But ALT + F11 should work!
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  9. #9
    Registered User
    Join Date
    02-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formatting Number as text Issue.

    Quote Originally Posted by Kevin UK View Post
    Hi DunkUK101

    Developer tab, left hand side, Visual Basic that will bring up the VBE. But ALT + F11 should work!
    Thank you Kevin and others so far with the help.

    How odd, my ALT+F11 gives no response at all...and VBE In the developer tab is greyed out?! See attached.
    Attached Images Attached Images

  10. #10
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,608

    Re: Formatting Number as text Issue.

    A greyed-out Visual Basic button indicates that this was not installed when Excel (or Office) 2007 was installed. To install Visual Basic, you need the original installation medium (DVD or downloaded file) for Excel 2007 (or Office 2007) and to use the customize option to select and install Visual Basic for Applications which is located within Office Shared Features

    ( same for 2010 I guess)

  11. #11
    Registered User
    Join Date
    02-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formatting Number as text Issue.

    Quote Originally Posted by Pepe Le Mokko View Post
    A greyed-out Visual Basic button indicates that this was not installed when Excel (or Office) 2007 was installed. To install Visual Basic, you need the original installation medium (DVD or downloaded file) for Excel 2007 (or Office 2007) and to use the customize option to select and install Visual Basic for Applications which is located within Office Shared Features

    ( same for 2010 I guess)
    Then it looks like I better go find my installation disc! Thank you all for the help!

+ 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