View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ExcelMonkey[_106_] ExcelMonkey[_106_] is offline
external usenet poster
 
Posts: 1
Default Counting Data Field within a Pivot Table

I have a routine that checks all the names of a pivot table's dat
fields (See Below). How can I count the number of data fields withi
the For Each Loop?



Sub DisplayDataFields()
Dim x As Variant
Dim Pivot1 As PivotTable
Set Pivot1 = Worksheets("Sheet1").PivotTables("Pivot Table 1")
For Each x In Pivot1.DataFields
'Display pivot field source name (name of field in original
'data)
MsgBox "Pivotfield SourceName is " & x.SourceName
Next
End Su

--
Message posted from http://www.ExcelForum.com