+ Reply to Thread
Results 1 to 6 of 6

Using VBA to highlight specific text in cell

  1. #1
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Using VBA to highlight specific text in cell

    Hi I have the following VBA code (see spreadsheet attached), which when run gives the following sentence in cell b10, "Attendance for Palm Beach is 19000, having increased from last year by 20%...."

    I am wondering could I alter the code so that percentage figures in the text are highlighted in green when they are above 10%.

    Help would be very much appreciated.

    Book1.xlsm

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Using VBA to highlight specific text in cell

    Hi Nav,
    try it

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Using VBA to highlight specific text in cell

    strange problems with the internet, the code is not inserted

    Sorry, there was a glitch yesterday

    Edited:
    I'll try to attach a file with the code
    Attached Files Attached Files
    Last edited by nilem; 08-11-2013 at 01:29 AM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Using VBA to highlight specific text in cell

    Try the attached.
    Attached Files Attached Files
    Last edited by jindon; 08-10-2013 at 05:55 PM.

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Using VBA to highlight specific text in cell

    same problem as jindon, this is my version
    Attached Files Attached Files
    Last edited by patel45; 08-11-2013 at 03:24 AM.
    If solved remember to mark Thread as solved

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Using VBA to highlight specific text in cell

    Apply the custom number format [<.1]0%;[green]0% to the cells in question.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ 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: 3
    Last Post: 08-02-2013, 12:43 PM
  2. Specific Text in Range then highlight cell
    By gingank in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2013, 10:41 AM
  3. [SOLVED] Highlight a range of cells if a single cell contains specific text
    By ZHertz in forum Excel General
    Replies: 3
    Last Post: 10-19-2012, 02:54 PM
  4. Highlight or pluck out a row which contains specific text
    By Daz783 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-13-2010, 12:05 PM
  5. Highlight a row if a specific cell is specific numbers/words
    By sea0221 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-08-2005, 09:06 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