+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting for percentage formatted cells

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2003, 07, 10
    Posts
    92

    Conditional formatting for percentage formatted cells

    I have posted before about conditional formatting and I have a piece of code that works for integer numbers but when I try to implement it for a cell that is formatted to percentages it doesn't work. The cells are also formatted with a formula. Sample workbook and code attached, I would greatly appreciated anyone who could help me.

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

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Conditional formatting for percentage formatted cells

    Dimension ILow and IHigh as single (which allow for decimals) and then set their values to -.03 and 0.5 in your routine
    Elegant Simplicity............. Not Always

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Conditional formatting for percentage formatted cells

    since excel uses Doubles internally I suggest you do the same-you will often find the change from single to double makes small alterations to your values
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Registered User
    Join Date
    06-26-2013
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2003, 07, 10
    Posts
    92

    Re: Conditional formatting for percentage formatted cells

    I have tried both single and double but the code is ignoring the less than condition where it turns green. There is only one field that is less than -3 (H32).

  5. #5
    Registered User
    Join Date
    06-26-2013
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2003, 07, 10
    Posts
    92

    Re: Conditional formatting for percentage formatted cells

    I see my problem now. -0.3 is 30 percent so I changed my 0.3 to 0.03 which makes the parameter 3 percent. Such a simple thing to get confused at! Thanks for the help guys

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Conditional formatting for percentage formatted cells

    worked for me on your sample-what is the exact code you tried?

+ 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: 2
    Last Post: 06-23-2012, 10:22 AM
  2. Replies: 3
    Last Post: 06-19-2012, 09:56 PM
  3. Replies: 2
    Last Post: 08-16-2009, 06:16 PM
  4. Replies: 1
    Last Post: 04-18-2006, 01:35 PM
  5. Replies: 5
    Last Post: 04-04-2005, 10:06 AM

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