Hi,
The following code works when changing the range of my PivotTables:
However, I am trying to modify the range dynamically using the CurrentRegion property, but cannot get it to work. And when I perform some debugging, I am not getting an address (or anything) returned:
Any ideas?
Denny
The following code works when changing the range of my PivotTables:
Code:
Dim PC As PivotCache
On Error Resume Next
For Each PC In ThisWorkbook.PivotCaches
PC.SourceData = "Data!R1C1:R100C5"
Next PC
However, I am trying to modify the range dynamically using the CurrentRegion property, but cannot get it to work. And when I perform some debugging, I am not getting an address (or anything) returned:
Code:
Dim PC As PivotCache
On Error Resume Next
For Each PC In ThisWorkbook.PivotCaches
PC.SourceData = Worksheets("Data").Range("A1").CurrentRegion.Address
Next PC
Any ideas?
Denny