Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot cache in VBA
Hi,
I want to create a pivot cache using VBA. If I write ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "A1:AC3167").CreatePivotTable TableDestination:="", _ TableName:="myPivotTable", DefaultVersion:=xlPivotTableVersion10 it works. But if I write myLastRow = Range("A1").End(xlDown).Row myLastColumn = Range("A1").End(xlToRight).column myRange = Range(Cells(1, 1), Cells(myLastRow, myLastColumn)) ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ myRange).CreatePivotTable TableDestination:="", _ TableName:="myPivotTable", DefaultVersion:=xlPivotTableVersion10 I get an "Type Mismatch" error. I tried various structures from for the myRange, but none worked. Any help apreciated. Ben |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
multiple pivot tables from 1 pivot cache | Excel Programming | |||
Pivot Cache | Excel Programming | |||
reading pivot cache | Excel Programming | |||
Pivot cache | Excel Discussion (Misc queries) | |||
Pivot Cache Memory | Excel Programming |