Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic sourcedata when copying chart within sheet [email protected] Charts and Charting in Excel 3 June 11th 08 03:37 PM
Pivot table with a variable range in the sourcedata field [email protected] Excel Discussion (Misc queries) 2 January 31st 07 12:11 AM
Excel/chart/sourcedata - should let me set the left or right axis belohls Charts and Charting in Excel 1 June 19th 06 10:43 PM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM
Dynamic Array as pivot table SourceData..? Robert Stober Excel Programming 0 October 3rd 03 05:36 PM


All times are GMT +1. The time now is 04:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"