LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Pivot Conditional Formatting

Sub Decorate()
Range("H14:H500").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add _
Type:=xlCellValue, _
Operator:=xlLess, _
Formula1:="=$I14"
Selection.FormatConditions(1) _
.Interior.ColorIndex = 3
Selection.FormatConditions.Add _
Type:=xlCellValue, _
Operator:=xlGreater, _
Formula1:="=$J14"
Selection.FormatConditions(2) _
.Interior.ColorIndex = 4
End Sub
Worked fine for me.


"Donica" wrote:

Range of Cells Conditional formatting based on:
I have data like this, 3 columns

H I J
1 1.67 1.37 2.00
2 4.63 1.37 2.00
3 2.17 1.25 1.50

If H1 is < I1 then color cell H1 Red
If H1 is J1 then color cell H1 Green
If H1 I1 and < J1 then cell H1 color Yellow
I need to continue this for all of H column Rage on a row by row basis, so
next would be column 2 calcs.

I got one part of this code to work, then it breaks - I think I need to have
more Pivot
language in it?
Sub Decorate()

Range("H14:H500").Select
Selection.FormatConditions.Delete

Selection.FormatConditions.Add Type:=xlExpression, _
Formula1:="=$H14 < $I14"
Selection.FormatConditions(1).Interior.ColorIndex = 3

'Breaks -----
Selection.FormatConditions.Add Type:=xlExpression, _
Formula2:="=$H14 $J14"
Selection.FormatConditions(1).Interior.ColorIndex = 4


Would really appreciate some ideas..

Thanks for help,

--
Regards,

Donica

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting in Pivot Based on other values in pivot. XL Mats M Excel Discussion (Misc queries) 0 November 7th 07 10:36 AM
Conditional Formatting in Pivot Table peter Excel Worksheet Functions 1 June 29th 07 04:16 PM
Pivot Conditional formatting Donica Excel Programming 0 May 2nd 07 01:01 AM
pivot table conditional formatting robski Excel Discussion (Misc queries) 0 March 13th 07 09:20 PM
Is it possible to add conditional formatting in a pivot-table? Saddy Excel Discussion (Misc queries) 1 July 4th 06 06:28 PM


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"