+ Reply to Thread
Results 1 to 2 of 2

Pivot Table Automation

  1. #1
    Jonathan
    Guest

    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. #2
    Jonathan
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1