Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting up a SourceData:= in VB
I currently have the following code written in VB:
Worksheets("Pivots").Activate Range("A21").Activate Sheets("Pivots").PivotTableWizard SourceType:=xlPivotTable, SourceData:= _ "[Fox Raven Market Share Tool 2.xls]Pivot Table! PivotTable1" How can I make this code smarter (I'd like to remove the [Fox Raven Market Share Tool 2.xls] reference from it. Thanks for your help, Emmanuel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting up a SourceData:= in VB
Emmanuel
OK, go ahead and do it. It looks like Pivot Table is the name of the sheet in Fox Raven Market Share Tool 2.xls, so if you remove the file name, it will look for a sheet in the current workbook with that name. I haven't actually tried it, but it should work. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Emmanuel" wrote in message ... I currently have the following code written in VB: Worksheets("Pivots").Activate Range("A21").Activate Sheets("Pivots").PivotTableWizard SourceType:=xlPivotTable, SourceData:= _ "[Fox Raven Market Share Tool 2.xls]Pivot Table! PivotTable1" How can I make this code smarter (I'd like to remove the [Fox Raven Market Share Tool 2.xls] reference from it. Thanks for your help, Emmanuel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamic sourcedata when copying chart within sheet | Charts and Charting in Excel | |||
Pivot table with a variable range in the sourcedata field | Excel Discussion (Misc queries) | |||
Excel/chart/sourcedata - should let me set the left or right axis | Charts and Charting in Excel | |||
Setting default pivot table field setting to "sum" | Excel Discussion (Misc queries) | |||
Dynamic Array as pivot table SourceData..? | Excel Programming |