Results 1 to 6 of 6

Conditional formatting for percentage formatted cells

Threaded View

boomboomblock Conditional formatting for... 07-22-2013, 05:13 AM
AndyLitch Re: Conditional formatting... 07-22-2013, 06:39 AM
JosephP Re: Conditional formatting... 07-22-2013, 06:42 AM
boomboomblock Re: Conditional formatting... 07-22-2013, 06:59 AM
boomboomblock Re: Conditional formatting... 07-22-2013, 07:45 AM
JosephP Re: Conditional formatting... 07-22-2013, 07:46 AM
  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
    Sub ConditionalFormatting()

    lLow = -3

    lHigh = 50

    Set rng = Range("H5:H19, H21:H24, H26:H29, H26:H29, H31:H36, H38:H44") 'Range
    rng.FormatConditions.Delete ' delete any pre-existing formatting

    ' add greater than condition
    With rng.FormatConditions.Add(xlCellValue, xlGreater, lHigh)
    .Interior.Color = rgbRed
    End With

    ' add less than condition
    With rng.FormatConditions.Add(xlCellValue, xlLess, lLow)
    .Interior.Color = rgbGreen
    End With

    ' add middle condition
    With rng.FormatConditions.Add(xlCellValue, xlBetween, lHigh, lLow)
    .Interior.Color = rgbGold
    End With

    End Sub
    Attached Files Attached Files

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