How to properly setup a SourceData

E

Emmanuel

I currently have the following VB code:

Worksheets("Pivots").Activate
Range("A21").Activate
Sheets("Pivots").PivotTableWizard SourceType:=xlPivotTable, SourceData:= _
"[Fox Raven Market Share Tool 2.xls]Pivot Table!PivotTable1"

The only problem is that if I change the Excel filename, the macro does not work because it is reference the Excel Name. How can I make this query "smarter" (i.e. removing/replacing the following statement "[Fox Raven Market Share Tool 2.xls]Pivot Table!PivotTable1")

Thanks for your help,
Emmanuel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top