Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default accessing pivot talbes using dom

Hi:
How can I enumerate all he pivot tables in a work book using the dom/vb
code?
Cheers
Sean.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default accessing pivot talbes using dom

Hi Sean,

Below is the vba code that you can use to walk through each PT in a workbook.

Sub enumeratePT()
Dim ws As Worksheet
Dim pt As PivotTable
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select
For Each pt In ws.PivotTables
Debug.Print pt.Name
' pt.PageFields("COLUMN1").DataRange = "VALID VALUE IN COLUMN1"
' pt.PageFields("COLUMN2").DataRange = "VALID VALUE IN COLUMN2"
Next pt
End If
Next
End Sub

Hong Quach

"Sean Farrow" wrote:

Hi:
How can I enumerate all he pivot tables in a work book using the dom/vb
code?
Cheers
Sean.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default accessing pivot talbes using dom

Hi:
Just what I needed.
Sean.
"Hong Quach" wrote in message
...
Hi Sean,

Below is the vba code that you can use to walk through each PT in a
workbook.

Sub enumeratePT()
Dim ws As Worksheet
Dim pt As PivotTable
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select
For Each pt In ws.PivotTables
Debug.Print pt.Name
' pt.PageFields("COLUMN1").DataRange = "VALID VALUE IN
COLUMN1"
' pt.PageFields("COLUMN2").DataRange = "VALID VALUE IN
COLUMN2"
Next pt
End If
Next
End Sub

Hong Quach

"Sean Farrow" wrote:

Hi:
How can I enumerate all he pivot tables in a work book using the dom/vb
code?
Cheers
Sean.





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
problem accessing Pivot table Excel 2007 ann Excel Worksheet Functions 0 February 19th 09 05:42 AM
Pivot table accessing external data Jwaltb Excel Discussion (Misc queries) 6 February 22nd 07 06:04 PM
Accessing data in pivot tables [email protected] Excel Programming 2 June 12th 06 04:33 PM
Accessing Pivot Table's Data in VBA spjoseph0511 Excel Programming 3 November 14th 03 03:15 AM
Accessing Pivot Table's Data spjoseph0511[_2_] Excel Programming 1 November 13th 03 07:36 PM


All times are GMT +1. The time now is 11:05 PM.

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"