LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Updating pivot items on 3 pivot tables contained on one sheet

Hi,

I have this code that updates pivot items on all three pivot tables which
reside on one sheet. Why doesn't this code work? When the user selects a
drop-down pivot item (named the "DAC" field) in cell H2, all pivot items
should updated to reflect this new value for the DAC field. Below is the
code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws, pt, pi, strField blah, blah, blah
strField = "DAC"
On Error Resume Next
If Target.Address = Range("H2").Address Then
For Each pt In ws.PivotTables
With pt.PageFields(strField)
For Each pi In .PivotItems
If pi.Value = Target.Value Then
..CurrentPage = Target.Value
Exit For
Else
..CurrentPage = "(All)"
End If
Next pi
End With
Next pt
End If

End Sub


Does anyone have any answers?

Thank-you for your help!

--
Kent Lysell
Financial Consultant
Ottawa, Ontario
W: 613.948-9557
 
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
Updating pivot items in three pivot tables on one sheet via VBA klysell Excel Programming 0 August 8th 07 07:20 PM
Updating all pivot tables at once rascal Excel Worksheet Functions 1 March 28th 07 01:44 AM
Name items in Pivot Tables? Sheila D Excel Discussion (Misc queries) 4 December 1st 06 01:54 PM
Cycle through Pivot Tables with Pivot Items [email protected] Excel Programming 0 October 15th 06 10:31 PM
updating pivot tables jgibbings Excel Discussion (Misc queries) 3 May 9th 05 11:02 PM


All times are GMT +1. The time now is 12:53 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"