View Single Post
  #4   Report Post  
Debra Dalgleish
 
Posts: n/a
Default pivot table created from another pivot table

If you provide more information on what you're trying to do, someone
might be able to help you adapt the code to your worksheet.

Kreed wrote:
This is very much on the track that I need to be on. From what I see in the
sample file, it is in visual basic that I would need to do this programming.
I can somewhat follow what programming; however, I have a few attributes in
the Page field that I would need to link. What could I do with this
programming to help me get there?

Here is the programming that I copied:

Option Explicit

Dim mvPivotPageValue As Variant

Private Sub Worksheet_Calculate()
Dim wsOther As Worksheet
Dim pt As PivotTable
Dim pt1 As PivotTable
Dim pt2 As PivotTable
Dim strField As String

Set wsOther = Sheets("Other Pivots")
Set pt = Me.PivotTables(1)
Set pt1 = wsOther.PivotTables(1)
Set pt2 = wsOther.PivotTables(2)
strField = "Market"

If LCase(pt.PivotFields("Market").CurrentPage) < LCase(mvPivotPageValue) Then
Application.EnableEvents = False
pt.RefreshTable
mvPivotPageValue = pt.PivotFields(strField).CurrentPage
pt1.PageFields(strField).CurrentPage = mvPivotPageValue
pt2.PageFields(strField).CurrentPage = mvPivotPageValue
Application.EnableEvents = True
End If

End Sub

Any ideas? Thanks!

"Debra Dalgleish" wrote:


You can do this with programming. There's a sample file he

http://www.contextures.com/excelfiles.html

Under PivotTables, look for 'Change Page Field'


Kreed wrote:

I was able to create a pivot table using an established pivot table; however,
the established pivot table has filters (created using the PAGE area of the
layout). I was hoping that when the established pivot table is filtered on
(thus changing the data within the pivot), it would update the newly created
pivot with the same filters. Is there something I should do that would
acheive what I desire in this second pivot table? Thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html