Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
In the VBA online help it says that the SourceData property accepts "an array of ranges". If this is true, may anyone advise why the following code failed? Thanks. Sub CreatePivot() Dim MonthlyData(1 To 12) As Range Dim i As Integer For i = 1 To 12 Set MonthlyData(i) = Worksheets(i).Range("A1").CurrentRegion Next ActiveSheet.PivotTableWizard _ SourceType:=xlDatabase, _ SourceData:=MonthlyData, _ tablename:="YearlySales" End Sub Frederick Chow Hong Kong. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
PivotTableWizard help with VB | Excel Worksheet Functions | |||
Dynamic sourcedata when copying chart within sheet | Charts and Charting in Excel | |||
SourceData in pivot table | Excel Programming | |||
Change SourceData in Excel PivotTable via VBA | Excel Programming | |||
Setting up a SourceData:= in VB | Excel Programming |