S
Sid
My objective is not define an absolute range for the pivot table, so when I
add data later on my pivot tabel will capture it without having to modify my
source data address.
I keep getting Run time error '1004' - Apllication defined or Object defined
error in the following code:
Sub creatpivot_table()
Dim PTCache As PivotCache
Dim PT As PivotTable
Set PTCache = ActiveWorkbook.PivotCaches.Add _
(SourceType:=xlDatabase, _
SourceData:=Range("A1").CurrentRegion.Address)
Set PT = PTCache.CreatePivotTable(TableDestination:="",
TableName:="PivotTable4")
With PT
..PivotFields("CARDMEMBER_NAME").Orientation = xlRowField
..PivotFields("BILLING_AMOUNT").Orientation = xlDataField
End With
End Sub
add data later on my pivot tabel will capture it without having to modify my
source data address.
I keep getting Run time error '1004' - Apllication defined or Object defined
error in the following code:
Sub creatpivot_table()
Dim PTCache As PivotCache
Dim PT As PivotTable
Set PTCache = ActiveWorkbook.PivotCaches.Add _
(SourceType:=xlDatabase, _
SourceData:=Range("A1").CurrentRegion.Address)
Set PT = PTCache.CreatePivotTable(TableDestination:="",
TableName:="PivotTable4")
With PT
..PivotFields("CARDMEMBER_NAME").Orientation = xlRowField
..PivotFields("BILLING_AMOUNT").Orientation = xlDataField
End With
End Sub