Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default URGENT! How to read value in pivot table

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default URGENT! How to read value in pivot table

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default URGENT! How to read value in pivot table

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default URGENT! How to read value in pivot table

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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default URGENT! How to read value in pivot table

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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default URGENT! How to read value in pivot table

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


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default URGENT! How to read value in pivot table

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


  #8   Report Post  
Posted to microsoft.public.excel.programming
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 -


  #9   Report Post  
Posted to microsoft.public.excel.programming
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


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default URGENT! How to read value in pivot table

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





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,344
Default URGENT! How to read value in pivot table

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




  #12   Report Post  
Posted to microsoft.public.excel.programming
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





Reply
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
Multiple Range Pivot Table (Urgent Please) FARAZ QURESHI Excel Discussion (Misc queries) 0 September 15th 07 06:28 AM
URGENT PLEASE! Filtering a Pivot Table further hile trotman Excel Worksheet Functions 4 February 1st 07 04:32 PM
Pivot Table Nightmare Urgent help required rivers Excel Programming 0 August 25th 06 02:33 PM
pivot table error.Please help! very urgent anu_manu Excel Discussion (Misc queries) 0 February 13th 06 08:34 PM
urgent-pivot table monika Excel Programming 7 July 25th 04 01:00 PM


All times are GMT +1. The time now is 08:05 AM.

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

About Us

"It's about Microsoft Excel"