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.
Related
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
I am working with an Excel 2013 workbook on Windows 10. It has ten pivot tables and takes a long time (~2 mins) to open. I have tried a lot of things to speed this up to no avail. Here are the specs:
The workbook is about 40 Mbytes in size. It is an *.xlsm file with a significant VBA app that can be activated by clicking a button. However, there is no Workbook Open event and no worksheet level events.
All of the pivot tables are based on data from a single worksheet within the workbook. No external data.
All of the pivot tables are set to NOT refresh on open. They are also set to not save data. (I tried both ways and if anything setting it to save data caused it to take longer to open.)
The pivot tables contain no formulas. The data worksheet has no formulas. The workbook in its entirety has very few formulas. The app creates formulas to populate the sheets, but then converts all of the formulas to values.
The pivot tables did have conditional formats, but even after deleting them all, the workbook still takes about the same time to come up.
This is not the startup delay issue. There is a dialog telling me that the load is 0% … 20% … 40% … complete.
I deleted just the pivot table sheets from the workbook and the workbook comes up in just a few seconds.
I also created a new workbook by copying over all the sheets and code thinking there might be a low-level corruption issue, but the copy didn't come up any faster.
Do pivot tables just naturally come up slow? Is there any property or setting I can change to speed up the workbook opening process? A number of people use these workbooks and are very dissatisfied.
Right click inside pivot, Pivot Table options, Data tab, clear/uncheck the checkbox "Save source data with file."
Every time you create a Pivot, Excel stores a copy of the source data in the file and uses it to run queries. If you created 10 Pivots separately, you'll have 10 caches saved in the file making it bloated/slow. To optimize the file, you'll want to create a Pivot and then COPY that Pivot for ALL other Pivots that use the SAME data table. This will ensure you use only 1 cache instead of 10. Also, as a bonus, when you refresh one it'll refresh all of them.
**Only keep this unchecked if there's no external data.
Cheers
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.
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
How can I export a PowerPivot table to a new workbook without the attached data model?
Even if I click paste values, Excel makes the file unreasonably large (13MB).
Can I turn this behaviour off?
When you say pasting a Power Pivot table, do you mean copying the table that exists in the data model, that you access through clicking the "Manage" button in the Power Pivot ribbon menu?
Or do you mean copying the values displayed in an Excel pivot table that happens to be backed by a Power Pivot model?
If the former, you can paste the table directly into a new workbook sheet (assuming it has fewer rows than Excel's limit) with no problems and no attachment made to the source workbook's data model.
If the latter, pasting values will bring over only the values, but you have to utilize the right click menu option to do so. If you just CTRL-C CTRL-V the pivot table, and then use the copy-paste context menu to change to values only, then Excel is first creating a copy of the data model in the new workbook to back the pivot table that you are pasting. Then after this action is completed, you are telling it to display values only, but Excel will not delete the data model it's just created to back the pivot table.
I just ran into this problem, it was very easy to resolve. Initially I was trying to paste as values into the destination workbook directly from the source Pivot table which automatically brings the data model across with it.
Simply make a copy of the table by pasting values into the SAME workbook as your data model. Then copy and past the new table into your destination workbook, it will just give you the values and leave the data model behind.