+ Reply to Thread
Results 1 to 6 of 6

Macro not working for conditional formatting

  1. #1
    Registered User
    Join Date
    06-09-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    Macro not working for conditional formatting

    I am using conditional formatting to find the min. value in each row.
    It ignore the 0 when the clicking on the conditional formatting but when i run it using macro, it take the 0 as the lowest value
    Any one can help?

    My formula is
    =A2=MIN(IF($A2:$C2<>0,$A2:$C2))

    All column are formatted to number value.

    Capture.PNG

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Macro not working for conditional formatting

    You have described two different outcomes, but you didn't say which outcome you want. What result do you want? And which one do you want to change--conditional formatting, or code?

    When asking questions about code please show your code. Use code tags to show code. There are two ways to add code tags. One is to select the code part of the text so it is highlighted, then press the "#" button in the edit controls. The other is to simply type in the tags:

    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]


    Even better would be to attach your file. The paper clip icon does not work for attachments. Instead, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    06-09-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    Re: Macro not working for conditional formatting

    I am trying to highlight the minimum value in each but i am not sure if my code or formula is wrong.

    Please Login or Register  to view this content.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Macro not working for conditional formatting

    I do see that if I run your macro, it highlights zeroes, but if I enter the same formula by hand in conditional formatting, it does not highlight zeroes.

    Once again, what result do you want? Do you want to ignore 0, or highlight 0 if it's the min?

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Macro not working for conditional formatting

    I do not know why these two ways of inserting the formula give different results, but you are missing the FALSE part of your IF function. If you want to not highlight zeroes, you should use some very large number, like

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-09-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    Re: Macro not working for conditional formatting

    In my case, my file is a list of product price from different companies. 0 means no product found
    So, I wanted to highlight the lowest prices in each row (ignoring the 0)

    I tried the above formula,it doesnt work in my case.
    Any advice on how i should write the IF part?
    I also tried MIN(IF(ISNUMBER(A2:C2),IF(A2:C2>0,A2:C2))) but it doesn't worked.
    Last edited by raneerina; 06-09-2018 at 10:33 AM.

+ 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 not working
    By Str1der in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2014, 09:08 AM
  2. [SOLVED] Conditional Formatting not working anymore - Macro enable workbook
    By Lukael in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-20-2014, 11:43 AM
  3. [SOLVED] Conditional Formatting not working!
    By mega_nerd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-13-2013, 02:16 AM
  4. Conditional Formatting not Working
    By braydon16 in forum Excel General
    Replies: 7
    Last Post: 05-23-2012, 02:41 PM
  5. Several Conditional Formatting only working on some
    By joblinger in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-20-2009, 05:17 PM
  6. VBA conditional formatting not working
    By LarryC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-26-2008, 09:43 AM
  7. Conditional Formatting Not Working In Macro
    By davehunter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2007, 01:29 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