+ Reply to Thread
Results 1 to 3 of 3

Compund formulae in conditional formatting

Hybrid View

  1. #1
    Registered User
    Join Date
    11-08-2014
    Location
    london
    MS-Off Ver
    2013
    Posts
    49

    Compund formulae in conditional formatting

    Hi. I need to highlight a cells in a range in column N based on 2 conditions. Firstly if its non numeric. The second is that if it is not equal to a different cell in column M - however only if the cell in row M is not zero. Hence I need a compound formulae (see below). I guess I have got the compound formulae Formula1:="=((M2<>N2) And M2 > 0)") wrong as it gets kicked out by the debugger. Any ideas on how to make it work would be gratefully received. Many thanks Tony

     
     With ThisWorkbook.Worksheets(1).Range("N2:N" & ColRange)
         With .FormatConditions.Add(Type:=xlExpression, Formula1:="=NOT(ISNUMBER(N2))")
                    .Interior.Color = RGB(255, 255, 0)
          End With
          With .FormatConditions.Add(Type:=xlExpression, Formula1:="=((M2<>N2) And M2 > 0)")
                    .Interior.Color = RGB(255, 255, 0)
          End With
    End With

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Compund formulae in conditional formatting

    Assuming your logic is correct, it should be:
    Formula1:="=AND(M2<>N2, M2>0)")
    多么想要告诉你 我好喜欢你

  3. #3
    Registered User
    Join Date
    11-08-2014
    Location
    london
    MS-Off Ver
    2013
    Posts
    49

    Re: Compund formulae in conditional formatting

    Perfect. All sorted. Many thanks.

+ 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. conditional Formatting based on if formulae.
    By mr_mead in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-10-2013, 07:59 AM
  2. Conditional Formatting using Formulae
    By andrewc in forum Excel General
    Replies: 5
    Last Post: 04-07-2011, 11:20 AM
  3. Using VB code to copy formulae and conditional formatting.
    By nephilim3uk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2010, 01:19 PM
  4. Conditional formatting in formulae?
    By keelbolt in forum Excel General
    Replies: 3
    Last Post: 08-18-2010, 12:26 PM
  5. [SOLVED] Nested functions in conditional formatting formulae
    By Joseph in forum Excel General
    Replies: 3
    Last Post: 10-20-2005, 07: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