M
Michael
Greetings All,
I would appreciate help with the following problem. I am running
Excel 97 under Windows 2000.
The situation:
I have 2 pivot tables (lets call them A and B) on one worksheet. Both
reference the same worksheet table as their sources. Both have the
same 2 page fields, and one simple datafield each. Pivot table A uses
a single column field (i.e., horizontal orietation) while B uses a
single row field (giving it a vertical orientation. A is higher on
the sheet than B.
The problem:
I am using VBA code to first clear and then re-make pivot table B with
exactly the same position and structure as before. It works, and I
have verified that my clearing procedure only affects B. But after
the following line of code, pivot table A vanishes. I have isolated
the disappearance to this statement:
'Remake pivot table B. ======================================
wsReport.PivotTableWizard SourceType:=xlDatabase, SourceData:=strSrce,
TableDestination:=rngPTLocum, TableName:=strPTName,
ColumnGrand:=False, HasAutoFormat:=False, RowGrand:=False
'end of code snippet. =======================================
Before this single line is executed, pivot table A is all present and
accounted for. After stepping this single line pivot table A is GONE
(while B is created nicely as expected).
Please note:
rngPTLocum is the single cell reference for B's position, and is
several lines below the last row of A. A and B coexist happily before
this automated re-build runs. There is no impinging of page fields on
data fields or vice versa between the two pivot tables.
This is a major puzzle for me and any knowledgeable help will be
appreciated.
Michael
I would appreciate help with the following problem. I am running
Excel 97 under Windows 2000.
The situation:
I have 2 pivot tables (lets call them A and B) on one worksheet. Both
reference the same worksheet table as their sources. Both have the
same 2 page fields, and one simple datafield each. Pivot table A uses
a single column field (i.e., horizontal orietation) while B uses a
single row field (giving it a vertical orientation. A is higher on
the sheet than B.
The problem:
I am using VBA code to first clear and then re-make pivot table B with
exactly the same position and structure as before. It works, and I
have verified that my clearing procedure only affects B. But after
the following line of code, pivot table A vanishes. I have isolated
the disappearance to this statement:
'Remake pivot table B. ======================================
wsReport.PivotTableWizard SourceType:=xlDatabase, SourceData:=strSrce,
TableDestination:=rngPTLocum, TableName:=strPTName,
ColumnGrand:=False, HasAutoFormat:=False, RowGrand:=False
'end of code snippet. =======================================
Before this single line is executed, pivot table A is all present and
accounted for. After stepping this single line pivot table A is GONE
(while B is created nicely as expected).
Please note:
rngPTLocum is the single cell reference for B's position, and is
several lines below the last row of A. A and B coexist happily before
this automated re-build runs. There is no impinging of page fields on
data fields or vice versa between the two pivot tables.
This is a major puzzle for me and any knowledgeable help will be
appreciated.
Michael