Hi,
I have been able to create pivot tables dynamically one after the another and I am also able to provide the gaps of 5 rows between the pivot tables. What I need is to insert a Heading for each of the pivot table.
For creating a pivot table, I use the following code. The "PivotTable1" already exists and the following code is to add a second pivot table "PivotTable2".
With ActiveSheet.PivotTables("PivotTable1")
Set rng = .TableRange1
.PivotCache.CreatePivotTable _
TableDestination:=rng.Offset(rng.Rows.Count + 5, 0).Cells(1, 1).Address(, , xlR1C1, True), _
TableName:="PivotTable2", _
DefaultVersion:=xlPivotTableVersion10
End With
Now, what I need is, I want to add a heading for each of the Pivot table that gets created. I am able to obtain the address of the range also.
MsgBox rng.Address
All I need is to identify the next row of the range and put my Heading. Is there any simple way to do this.
Thanks in advance.
I have been able to create pivot tables dynamically one after the another and I am also able to provide the gaps of 5 rows between the pivot tables. What I need is to insert a Heading for each of the pivot table.
For creating a pivot table, I use the following code. The "PivotTable1" already exists and the following code is to add a second pivot table "PivotTable2".
With ActiveSheet.PivotTables("PivotTable1")
Set rng = .TableRange1
.PivotCache.CreatePivotTable _
TableDestination:=rng.Offset(rng.Rows.Count + 5, 0).Cells(1, 1).Address(, , xlR1C1, True), _
TableName:="PivotTable2", _
DefaultVersion:=xlPivotTableVersion10
End With
Now, what I need is, I want to add a heading for each of the Pivot table that gets created. I am able to obtain the address of the range also.
MsgBox rng.Address
All I need is to identify the next row of the range and put my Heading. Is there any simple way to do this.
Thanks in advance.