+ Reply to Thread
Results 1 to 3 of 3

Formatting in excel for highlighting of specific text within a cell

  1. #1
    Registered User
    Join Date
    05-22-2013
    Location
    Mass, US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Formatting in excel for highlighting of specific text within a cell

    hi everyone... i am creating a table and I was wondering if anyone knew if it is possible to have a table formatted so that specific text within that cell automatically highlights. For example:

    Stock Number Ref # NUMBER OF FILE
    485258714 5443131-89 M0569830261630
    676825135 25468731-9 T210367284C024
    6864310215 35467981-8 G9304172216013

    In this example I want excel to automatically highlight the middle 4 numbers in this 14 number entry. I want it to make the first 6 numbers black, next 4 numbers red, next 4 numbers black. Does anyone know if there is a formula or a way to format this column in excel so it does this for all entries in this column without me having to go through and highlight the changes individually? In this example this NUMBER OF FILE column is column G.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Formatting in excel for highlighting of specific text within a cell

    mig6462,

    Welcome to the forum!
    Give this macro a try, note that you'll need to change the sheet name to the correct sheet name:
    Please Login or Register  to view this content.


    How to use a macro:
    1. Make a copy of the workbook the macro will be run on
      • Always run new code on a workbook copy, just in case the code doesn't run smoothly
      • This is especially true of any code that deletes anything
    2. In the copied workbook, press ALT+F11 to open the Visual Basic Editor
    3. Insert | Module
    4. Copy the provided code and paste into the module
    5. Close the Visual Basic Editor
    6. In Excel, press ALT+F8 to bring up the list of available macros to run
    7. Double-click the desired macro (I named this one tgr)
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-22-2013
    Location
    Mass, US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Formatting in excel for highlighting of specific text within a cell

    Thanks so much tigeravatar! This worked perfectly!

+ 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