Pivot table continues to be linked to old workbook - excel

I have a work book with two pivot tables in it. The pivots get their data from a sheet within the work book (say workbook 1).
I create a copy of workbook 1 (ctrl +c , ctrl+v). And rename the new work book as workbook 2. Now within work book 2 the pivots continue to remain linked to workbook 1. I've not seen this issue earlier.
I am using excel version 2013

Related

How to Dynamically update multiple PivotCaches in one workbook using VBA?

Every month, I run a massive Scorecard report. The raw data contains 13 workbooks that are exported as .csv files.
I use Power Query to manipulate and Append this data into 4 different worksheets.
To keep things clean, I then use a Macro to move the 4 Data Arrays into a Scorecard Workbook (which is shared with the team)
The Scorecard Workbook has 4 tabs with the Data Sheets: wsTotalUS, wsCombined, wsDFCoreMkts, wsNovCoreMkts.
The 4 Data Sheets to create 4 different Pivot Caches.
wsTotalUS has a Pivot Table on Sheet5
wsCombined has a Pivot Table on Sheets 6-13
wsDFCoreMkts has a Pivot Table on Sheet 14
wsNovCoreMkts has a Pivot Table on Sheet 15
Each month the data Rows can change (The Columns will always be the same - “A:AP”)
I have researched how to dynamically update pivot tables. I know some articles suggest changing the source data into a Table. I would like to avoid this due to the amount of time it would take to move the Data over to the Scorecard.
For example: wsTotalUS has 47,707 rows & wsCombined has 123,153 rows
One article I found had the code written on the Source Data Sheet as a Private Sub Worksheet_Deactivate().
However, this would only use one Data Sheet, and update all of the Pivot Tables in the workbook when you switch from the data sheet.
How to Dynamically Update All Pivot Tables Data Source in Excel
I found these articles, but they one only refers to one Data Sheet and one Pivot Table.
How to Automatically Update a Pivot Table Range in Excel
Dynamically Change a Pivot Table's Data Source Range with This VBA Code
This article uses the Worksheet_SelectionChange event. But again, only one Data Sheet is implied here.
Refresh Pivot Tables Automatically when Source Data Changes
How do I go about dynamically updating 4 different PivotCaches within a workbook?
Should I just run 4 separate sub routines?
UPDATED:
Based on Tim's suggestion:
Under Formulas -> Named Range:
TotalUS =OFFSET('Total US'!$A$1,0,0, COUNTA('Total US'!$A:$A),COUNTA('Total US'!$1:$1))
Then go to the Pivot Table that references this data, Change Data Source = TotalUS

How can I use Excel VBA to update links only in a specific worksheet and not the whole workbook?

I have an Excel file where some data from multiple geographies come together. People from one geography don't have access to the sharepoint of other geographies. Each geography has its own worksheet where the data should be updated once a month.
I would like to have a button on each worksheet where once a month someone from each geography updates their worksheet before it is bundled together into one worksheet.
The function .UpdateLinks only works with the whole workbook which is not desirable since the sharepoint access is divided.
I tried to set Excel calculation to manual and afterwards made a button to .Calculate that specific sheet but it seemed to work at first but is not reliable.
ThisWorkbook.Sheets("worksheet1").Calculate '(inconsistent)
ThisWorkbook.Sheets("worksheet1").UpdateLink '(doesn't work)
I would like to have a button to update links only in a specific worksheet and not the whole workbook.
The Workbook.UpdateLink method is located in Workbook and does not exist in Worksheet therefore it is only possible to update the links of the whole workbook but not of single worksheets only.
Updating links in single worksheets only is not supported.

Excel Smart Table as datasource for pivot

I have a Workbook D:\Sales.xlsx with a sheet named Orders. In this sheet there is a smart Table (Ctrl + T) named tblOrders.
In another Workbook E:\Reports.xlsx there is a sheet pvtOrders. When I create a pivot in this pvtOrders sheet and give D:\Sales.xlsx!tblOrders as datasource, it works fine while the source workbook Sales.xlsx is open in the same Excel instance. When the source is closed or opened in other Excel instance however refreshing of the pivot-Table is not working anymore. Excel prompts "Invalid reference" or similar (tested in Excel 2010, 2013).
The same problem is with a "normal" named range as source for the pivot table. However in this case there is no error prompt.
Is it a normal behavior? Is there a simple solution or at least a workaround without opening the source?
Thanks for any help
from my experience you need to have them open. have you considered merging both files? it might make things easier.

Powerpoint - remove embedded data from table

I pasted a pivot table from excel to powerpoint and chose the embed option when doing so. The deck is now very large (20MB +) due to the embedded data. Is there a way to keep the table but just drop the embedded data?
The problem is likely because you're copying from a very large Excel workbook. When you embed even one cell from an Excel worksheet, the entire workbook actually gets embedded in the PowerPoint file.
One way around this is to select the information you want to embed, copy/paste it into a new Excel workbook (NOT a new worksheet w/in the workbook), then copy/paste/embed into PPT from the new temporary workbook.
At least this'd work with regular worksheet data; it may not work for Pivot Tables (they'd be dependent on other data that wouldn't get pasted from one worksheet to the other, I'm afraid). But it's worth a shot.

Can I copy query tables (and connections?) to other workbooks?

I have a workbook (wkbk1) that has a sheet with eight different query tables (a.k.a. data tables) on it -- NOT PIVOT TABLES. They all point to the same external Excel workbook (wkbk2) for their data which is a single sheet with a group of named ranges.
The data for each table in wkbk1 comes from a named range in wkbk2. How can I copy the sheet of eight different tables (from wkbk1) to other workbooks (wkbk3, wkbk4, etc)?
Is it even possible for the query table and its data connection to transfer with the sheet? So far I can't do it manually (no coding). If coding is required I'm fine with that, just need help with it. I have intermediate VBA coding experience.
I'm using Excel 2007/2010.
In Excel 2010, I right click on the sheet tab and choose Move or Copy. Select the destination workbook and check "Create a Copy". The new sheet has the QueryTable on it and refreshes as expected.
So I think copying the sheet will copy the QueryTable and all its properties.
My QueryTable used MSQuery and pointed to another Excel workbook.

Resources