+ Reply to Thread
Results 1 to 6 of 6

Custom Formatting in Excel with Letters and Numbers

  1. #1
    Registered User
    Join Date
    10-24-2014
    Location
    hell0
    MS-Off Ver
    2010
    Posts
    3

    Custom Formatting in Excel with Letters and Numbers

    I am trying to use custom formatting in excel to show the following format for account numbers that I use:
    E-9511-I200-100-610
    The E is always constant, but the place where the I is typed can be either I or S or A.
    I can format for everything by the variable letter. So far, I have come up with "E""-""####"-"###"-"###"-"### but I don't know how to complete it to accept the variable letter. Please Help!

  2. #2
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Custom Formatting in Excel with Letters and Numbers

    Hi,

    What is the condition for I, S and A?

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,274

    Re: Custom Formatting in Excel with Letters and Numbers

    You are not entering a number - you are entering a string, and there are far fewer formatting options for strings. But, you could use the worksheet change event to convert the entry to the proper form. Copy the code below, right-click the sheet tab, select "View Code" and paste the code into the window that appears. Then save the workbook as a macro-enabled .xlsm As written, the code will check entries in cells B2:B100 - enter the values without the E: 9511I200100610


    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 10-24-2014 at 12:26 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  4. #4
    Registered User
    Join Date
    10-24-2014
    Location
    hell0
    MS-Off Ver
    2010
    Posts
    3

    Re: Custom Formatting in Excel with Letters and Numbers

    I am not sure that I understand your question. There is no condition. Depending upon the account # that I using (typing in), that place in the account number will either be an I, A or S. I am trying to format the cell so that I only have to type in the numbers and the one variable letter and not be bothered typing in the E and -.
    So if I type in 9511I200100610 it will show as E-9511-I200-100-610; if I type in 9511S000262420 it will show as E-9511-S000-262-420, etc.

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,274

    Re: Custom Formatting in Excel with Letters and Numbers

    Custom formatting will not work in your situation. See my post for a solution.

  6. #6
    Registered User
    Join Date
    10-24-2014
    Location
    hell0
    MS-Off Ver
    2010
    Posts
    3

    Re: Custom Formatting in Excel with Letters and Numbers

    Thank you, thank you, thank you!!!! I did it and it worked.

+ 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: 11
    Last Post: 12-14-2020, 09:46 AM
  2. [SOLVED] Conditional Formatting using letters and numbers
    By Excel_Beginner_1 in forum Excel General
    Replies: 4
    Last Post: 07-12-2012, 05:19 PM
  3. Excel custom format with letters and numbers
    By pdrodrig in forum Excel General
    Replies: 1
    Last Post: 06-11-2009, 08:08 AM
  4. [SOLVED] conditional formatting with letters and numbers
    By bta in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-31-2009, 07:42 AM
  5. [SOLVED] How do I change letters at top of excel to custom headers
    By painintheoffice in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10: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