View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
stoppal stoppal is offline
external usenet poster
 
Posts: 8
Default URGENT! How to read value in pivot table

Unforunately, I can't upgrade to 2007 do to a conflict issue with
another program we need to use.

When I say reference the value, I mean cell b5 has the value of a date
"12/31/2005", the pivot table has has a range of from a1 to c10

Therefore the values in cell b5 is populated with a value generated
from the pivot table. For some reason, I can not reference the cell
directly and pull the value. PLease see code above. Any ideas as to
how to read the value of the date in cell b5?

thanks



ShaneDevenshire wrote:
Hi,

I see, its not really conditional formatting its VBA controlled formatting.
I'm not sure what you mean by "reference the value", please elaborate. I
need more info to help with this.

Keep in mind that you will need to run the macro everytime you modify the
pivot table.

FYI - if and when you get Excel 2007 you will be able to add an unlimited
number of conditional formats, instead of just 3.

I'm at work this week so I won't always be able to respond quickly.
--
Thanks,
Shane Devenshire


"stoppal" wrote:

thank you for the extra help once again!!!

The reason I need to add condiftional formating using VBO rather than
the menu bar is b/c the program has a limit of 3 conditions. I need to
have at least 8 different conditions.

The code you provided at least provide some reference to the pivot
talbe, which is new to me, so thank you. do you know how to reference
the value?

thanks




ShaneDevenshire wrote:
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