Pivot create

  • Thread starter Thread starter Jesse
  • Start date Start date
J

Jesse

Can anyone help me figure out why this line of code does not work?

ActiveWorkbook.PivotTableWizard SourceType:=xlDatabase,
SourceData:=Sheets("BDData").UsedRange,
tabledestination:=Sheets("BD").Cells(1, 5), tablename:="BDPivot"


Jesse
 
Jesse said:
Can anyone help me figure out why this line of code does not work?

ActiveWorkbook.PivotTableWizard SourceType:=xlDatabase,
SourceData:=Sheets("BDData").UsedRange,
tabledestination:=Sheets("BD").Cells(1, 5), tablename:="BDPivot"

PivotTableWizard is a method of a worksheet, not a workbook.
So try

Sheets("BD").PivotTableWizard SourceType:=xlDatabase,
SourceData:=Sheets("BDData").UsedRange,
tabledestination:=Sheets("BD").Cells(1, 5), tablename:="BDPivot"


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup
 
Back
Top