View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
ShaneDevenshire ShaneDevenshire is offline
external usenet poster
 
Posts: 2,344
Default URGENT! How to read value in pivot table

Hi,

A little more detail would be useful - are you trying to have the
conditional formatting apply to the whole table? Is it the same condition
for all the cells in the table?

Here is a simple macro which applies conditional formatting to a specific
pivot table. All I did was turn on the recorder.

Sub Macro4()
ActiveSheet.PivotTables("PivotTable1").PivotSelect "", xlDataOnly, True
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:="10"
Selection.FormatConditions(1).Interior.ColorIndex = 22
End Sub

--
Cheers,
Shane Devenshire


"stoppal" wrote:

Hi,

I need some help. trying to use VB to read the value of a pivot table
so I can conditional format the cells. I know how to conditional
format using VB on normal cells, but I don't know how for pivot tables.
How can I reference values from a pivots table?

thank you