Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Pivot Table Automation

I was hoping that someone could give me some direction.

I have a pivot table in a main sheet. The data is from another excel sheet
in another file. The data file's name and length may change. For example: the
file name may change from "data 06-30" to "data 07-07"; the rows containing
data may change from 1000 to 1020.

How to use Macro to automatically update the pivot table from the
periodically changing datasource?

Thanks for any help.

Jon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Pivot Table Automation

I tried below program, but it doesn't work. Can someone help me? Thanks.

Sub LoadData()
Dim pv As PivotTable
Dim FileName As String

FileName = Application.GetOpenFilename

For Each pv In ThisWorkbook.Sheets("Sheet4").PivotTables
pv.SourceData = "'U:\Projects\5-Macrotize Reports\[" & FileName &
"]Sheet1'!A1:O30000"
Next


End Sub

"Jonathan" wrote:

I was hoping that someone could give me some direction.

I have a pivot table in a main sheet. The data is from another excel sheet
in another file. The data file's name and length may change. For example: the
file name may change from "data 06-30" to "data 07-07"; the rows containing
data may change from 1000 to 1020.

How to use Macro to automatically update the pivot table from the
periodically changing datasource?

Thanks for any help.

Jon

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
reference table automation Kerry Purdy Excel Worksheet Functions 0 June 5th 09 12:37 PM
Help with Table Automation OdAwG Excel Discussion (Misc queries) 14 March 4th 07 07:33 PM
problem with pivot table automation using perl [email protected] Excel Programming 0 March 21st 06 08:33 PM
Pivot Table Vba Automation In 2002 Barolo Excel Programming 0 August 18th 04 07:31 PM
Pivot Table Automation Questions JV[_2_] Excel Programming 1 June 3rd 04 12:52 PM


All times are GMT +1. The time now is 09:50 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"