+ Reply to Thread
Results 1 to 3 of 3

Format cell with text and numbers entered

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    El Paso, TX
    MS-Off Ver
    Excel 2007/2010
    Posts
    1

    Format cell with text and numbers entered

    I am trying to clean up some sloppy spreadsheets at a new job. This one I'm stuck on and don't know if is doable.
    We have a spreadsheet used as the database for a merge document; one of the columns entry is an account #. The account number is proceeded by one of three alpha combinations (of differing length) but is always 10 numerals. Ex: ABC 000-000-0000, XYZ 000-000-0000, and QRST 000-000-0000. Currently we have to enter it as text and type the dashes in each time. Is there a way to format the cells so that we just enter the letters and numbers, not the dashes, i.e. "abc0000000000".
    TIA

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Format cell with text and numbers entered

    In A1 Cell
    XYZ0000000000

    In B1 Cell
    =SUBSTITUTE(TRIM(A1),RIGHT(TRIM(A1),10)," ")&TEXT(RIGHT(TRIM(A1),10),"000-000-0000")


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Format cell with text and numbers entered

    welcome to the forum, keanve. do you mind typing in Column A & have the results in Column B? type this formula in B2:
    =LEFT(A2,3)&TEXT(RIGHT(A2,10)," 000-000-0000")

    to make it come out automatically as you type in Column A, convert the range to a Table. do that by selecting A1:B3 for eg & press CTRL + T. you can see Sheet2 of the file. type in A4 & B4 will be filled.

    if you mind an extra column, you might need to do VBA.
    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Double-click on the worksheet you want to apply too. Mine is in Sheet1
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    type into column A & it'll convert into the format you want. change this line of code to identify which column you want it applied to. Column A is 1, B is 2, & so on:
    Please Login or Register  to view this content.
    Attached Files Attached Files

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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. Replies: 6
    Last Post: 05-08-2013, 07:56 AM
  2. How to format numbers that are already entered?
    By Muriel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. How to format numbers that are already entered?
    By Muriel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. [SOLVED] How to format numbers that are already entered?
    By Muriel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  5. How to format numbers that are already entered?
    By Muriel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2005, 10:05 AM

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.6.0 RC 1