You are a star! Thank you very much!
"Debra Dalgleish" wrote:
You can count the rows in the tableranges, e.g.:
Dim pt As PivotTable
Set pt = Worksheets("PivotTable").PivotTables("TimePivot")
MsgBox pt.TableRange1.Rows.Count
MsgBox pt.TableRange2.Rows.Count 'includes page area
Desmond wrote:
I am having trouble of counting the number of rows in PivotTable, I have
tried to use
Worksheets("PivotTable").PivotTables("TimePivot"). PivotFields("Name").PivotItems.Count,
but it does not necessarily give the correct answer, any suggestions, thanks
in advance!
--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html