+ Reply to Thread
Results 1 to 7 of 7

VBA to Highlight the Certain Text in a Cell

  1. #1
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    VBA to Highlight the Certain Text in a Cell

    Hello All

    I have a production numbers of each individuals in Column "A" for each month in a cell.

    I need to compare the productivity with the defined targets from Column "B" and highlight the Text as below.

    Column A - Production Numbers

    Jan-22 Feb-23 Mar-24 Apr-23
    Jan-21 Feb-23 Mar-24 Apr-22
    Jan-22 Feb-23 Mar-24 Apr-22
    Jan-24 Feb-23 Mar-24 Apr-22
    Jan-22 Feb-23 Mar-24 Apr-22
    Jan-22 Feb-23 Mar-24 Apr-22
    Jan-22 Feb-23 Mar-24 Apr-25


    Column B - Targets

    24
    21
    22
    24
    23
    22
    25



    Target Met : Text Color Yellow
    Below Target : Text Color Red
    More than Target : Green

    I have searched and found the below code which highlights only one color.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: VBA to Highlight the Certain Text in a Cell

    Hi
    Is there a reason you are using a macro? conditional formatting would be simpler, I would think

  3. #3
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Re: VBA to Highlight the Certain Text in a Cell

    I tried conditional formatting whereas it could not able to highlight the specific text.

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

    Re: VBA to Highlight the Certain Text in a Cell

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Re: VBA to Highlight the Certain Text in a Cell

    This code is able to highlight the Text in Column which is matched with Targets from Column B with Red color.

    I also need to highlight the other text in column with two criteria's....

    1. Numbers does not met with Targets --- Need to be highlighted with some color
    2. Numbers exceeds the Target --- Need to highlighted with some color.

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

    Re: VBA to Highlight the Certain Text in a Cell

    Missed...
    Quote Originally Posted by mvinay View Post
    Target Met : Text Color Yellow
    Below Target : Text Color Red
    More than Target : Green
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Re: VBA to Highlight the Certain Text in a Cell

    This is working... Great effort...

    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. How to highlight the cell based on text
    By Ankit_Kumar in forum Excel General
    Replies: 4
    Last Post: 06-11-2015, 02:25 AM
  2. [SOLVED] Highlight a cell if the nth character is a certain number/text or starts with text
    By jcswaby in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-01-2015, 06:14 AM
  3. Replies: 8
    Last Post: 01-28-2014, 05:15 PM
  4. Using VBA to highlight specific text in cell
    By nav505 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-11-2013, 03:28 AM
  5. Highlight a text within a cell against an equal text in another cell.
    By fabdullaster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2013, 03:27 PM
  6. highlight the cell that contains different text
    By loade in forum Excel General
    Replies: 1
    Last Post: 07-05-2012, 02:59 PM
  7. Replies: 8
    Last Post: 03-30-2012, 07:52 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