View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
[email protected][_2_] thesquirrel@gmail.com[_2_] is offline
external usenet poster
 
Posts: 39
Default URGENT! How to read value in pivot table

I don't know what the value of the cells you are trying to access have
in them, but maybe you can try and do this.

Select Case DateValue(Target.Value)
Case #1/1/2001# To #12/31/2001# '2001

theSquirrel

On Dec 15, 11:59 am, "stoppal" wrote:
the mismatch seems to occur on these lines

Select Case Target
Case "1/1/2001" To "12/31/2001" '2001

But only when I reference a cell populated by a pivot table. If the
cell is normal (meaning no pivot table populated it) then all works. I
think there is a way to reference a cell within a pivot table, but I
don't know how.

thanks for your response. I hope someone can help. I'm at the end of
my wits!

thanks



wrote:
not sure i like the browbeating, and I have no knowledge of pivot
tables, but where are you getting your error? You state that its a
type mismatch, where is the mismatch?


theSquirrel


stoppal wrote:
I guess no one is smart out there or up to a challenge. This should be
rather simple. I'm surprised no one is has the brain power to answer
it.


stoppal wrote:
Is no one smart enough to know this?


stoppal wrote:
There must be someone that know's how to do this? I keep getting a
type mismatch, which is why I need to figure out how to reference the
pivot table cell not the normal cell.


PLEASE HELP!!!!!


Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer


If Not Intersect(Target, Range("Q1:Q500")) Is Nothing Then


Select Case Target
Case "1/1/2001" To "12/31/2001" '2001


icolor = 6


Case 37257 To 37621 '2002


icolor = 12


Case 37622 To 37986 '2003


icolor = 7


Case 37987 To 38352 '2004


icolor = 53


Case 38353 To 38717 '2005


icolor = 15


Case 38718 To 39082 '2006


icolor = 42


Case 39083 To 39447 '2007


icolor = 45


Case 39448 To 39813 '2008


icolor = 47


Case Else
'Whatever
End Select


Target.Interior.ColorIndex = icolor
End If


End Sub


stoppal wrote:
PLEASE ANY ONE! Does anyone know how to reference the cells of a pivot
table?


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- Hide quoted text -- Show quoted text -