Thread: Pivot create
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bill Manville Bill Manville is offline
external usenet poster
 
Posts: 473
Default Pivot create

Jesse wrote:
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