+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting not working on html code

  1. #1
    Registered User
    Join Date
    02-27-2020
    Location
    Boston, MA
    MS-Off Ver
    2016
    Posts
    2

    Conditional Formatting not working on html code

    Hi, I tried applying conditional formatting to a list of cells with html, and the formatting I get is completely out of whack. Instead of highlighting duplicate values, all cells that start with an opening tag <li> are highlighted (even if they're unique), and all cells that start with a closing tag </li> aren't highlighted (even if they occur more than once). COUNTIF is also acting weird--when I search for the value in B2, it returns the number of cells with the < character, and it returns 0 for values that start with </.

    It looks like Excel is automatically performing an action based on the < and </ characters, but I've been digging through forums and search results and can't find any mention of Excel treating these characters differently. Changing the cell format to Text or adding an apostrophe doesn't do anything. I've been using Highlight Duplicates for years and haven't found any characters that behave like this. I need to include exact html tags in my final document, so taking them out would add unnecessary steps.
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Conditional Formatting not working on html code

    Hi and welcome
    change the COUNTIF to
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I'll look at the CF

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,664

    Re: Conditional Formatting not working on html code

    The duplicate values CF fails for the same reason that the standard COUNTIF fails.

    Get rid of the rule you have and set up a formula CF rule instead using this:

    =COUNTIF(A:A, "="&A2)>1

    Applies to: =$A$2:$A$11
    Attached Files Attached Files
    Last edited by AliGW; 03-03-2020 at 12:49 PM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    02-27-2020
    Location
    Boston, MA
    MS-Off Ver
    2016
    Posts
    2

    Re: Conditional Formatting not working on html code

    This worked, thank you! Do you happen to know why excel doesn't work on the < character?

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,664

    Re: Conditional Formatting not working on html code

    All I can say is that I have seen similar behaviour before, which suggests that Excel gets confused by HTML code.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Conditional Formatting not working on html code

    It treats < in the criterion as meaning 'less than' as it normally would.
    Rory

+ 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: 1
    Last Post: 05-08-2019, 10:55 AM
  2. [SOLVED] VBA code to send Outlook email with HTML text no longer working
    By Twaddy006 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2016, 01:53 PM
  3. Range to HTML - Conditional Formatting
    By shauncasey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2015, 03:58 AM
  4. VBA Code for Conditional Formatting Not Working
    By lukazi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-08-2014, 12:16 PM
  5. [SOLVED] Conditional Formatting using VBA - Code not working properly
    By Tejas.T in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-07-2012, 10:19 AM
  6. unless the conditional formatting in HTML.
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-30-2012, 07:54 AM
  7. Conditional Formatting code not working
    By a8747 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-25-2011, 02:22 PM

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