VBA to update file path for pivot

Lefemmenikita

Board Regular
Joined
Jan 28, 2014
Messages
59
Office Version
  1. 2013
Platform
  1. Windows
Hi

I was wanting a vba code to update the data source for a pivot in a file so that it points to the current month.


E.g, I have a file called 'Manufacturing Month end May 2017'. This file is saved under C:/Accounts/May 17.


There is a pivot in that file pointing to[C:/Accounts/May 17/Raw data.xls]sheet1!A:Z

Now, when I save that file into the Jun folder, I want the pivot to now point to
[C:/Accounts/Jun 17/Raw data.xls]sheet1!A:Z



The 'Manufacturing Month end Jun 2017' report file will always be saved in the same network folder as the raw data



Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Cross-posted here: VBA to update file path for pivot

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule #13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
I will only post on one forum in future
If you try posting it somewhere else first, and don't get a resolution, we do not have a problem with your posting it here also. We just ask that you mention that you did so and provide a link to it.
That way, others can see what was already done and don't waste or duplicate efforts.

Thanks.
 
Upvote 0
Bumping up this thread and adding one amendment to the code requirement:


Is there a VBA code which allows you to link a pivot to an external data source and is pointing to a specific tab in the external data source?

e.g. Manufacturing Jun 17 month end workbook contains a pivot that points to the tab called 'Manufacturing' in a workbook called Raw data.xlsx.
The Raw data file is saved in the same folder
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,853
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top