+ Reply to Thread
Results 1 to 13 of 13

Copy Pivot Table with the source date to new workbook

  1. #1
    Registered User
    Join Date
    10-18-2017
    Location
    UAE
    MS-Off Ver
    2010
    Posts
    8

    Copy Pivot Table with the source date to new workbook

    Hi,
    Need help to copy a sheet with Pivot Table.
    1. In 'File 1' (Name of the File) - Sheet 1 has pivot tables and Data Source. Data is in A1:D100 and Pivot is in H1.
    2. Using 'Move or Copy' sheet, I want to copy the entire sheet (Sheet 1) and save this file as 'File 2'
    3. When i checked the Data Source of the Pivots in 'File 2', the data is picking from 'File 1'. I want this to be from 'File 2' automatically after save as new file.
    Hope that my question is clear.
    Thanks J

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copy Pivot Table with the source date to new workbook

    Welcome to the forum

    Download the attached file and run the macro with {CTRL} k
    The new workbook is saved to the same folder
    Amend macro to suit your requirements

    Please Login or Register  to view this content.
    Since you are a new memeber it may help you to know this for the future:
    - read this page - it is very helpful
    - it is helpful to see what you are looking at
    - to attach a workbook click GoAdvanced\ look below & click ManageAttachments \ follow instructions in upload window
    - always enclose any code in code tags (click on # icon above post area and insert code INSIDE the tags that appear)
    - click on *Add Reputation to thank those who help you
    Attached Files Attached Files
    Last edited by kev_; 04-08-2018 at 03:38 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Copy Pivot Table with the source date to new workbook

    maybe use "new book"

    nb.jpg

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copy Pivot Table with the source date to new workbook

    @sandy666 yes

  5. #5
    Registered User
    Join Date
    10-18-2017
    Location
    UAE
    MS-Off Ver
    2010
    Posts
    8

    Re: Copy Pivot Table with the source date to new workbook

    -Sandy666 but with the new book, still the data source of the pivot will be from the main sheet

  6. #6
    Registered User
    Join Date
    10-18-2017
    Location
    UAE
    MS-Off Ver
    2010
    Posts
    8

    Re: Copy Pivot Table with the source date to new workbook

    kev_ ; this will help me. thanks for your time

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Copy Pivot Table with the source date to new workbook

    Got it after that you can change source. This is not one-click of course

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copy Pivot Table with the source date to new workbook

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Registered User
    Join Date
    10-18-2017
    Location
    UAE
    MS-Off Ver
    2010
    Posts
    8

    Re: Copy Pivot Table with the source date to new workbook

    I have made the following changes to the code.

    - Copy & Save Multiple sheets from the workbook
    - Change the data source of more than one Pivot tables in the saved sheet.

    do you have any other suggestions for the code below:
    Please Login or Register  to view this content.
    Thanks.
    Last edited by vmjamshad; 04-09-2018 at 03:23 AM.

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copy Pivot Table with the source date to new workbook

    Is your new code working correctly?

  11. #11
    Registered User
    Join Date
    10-18-2017
    Location
    UAE
    MS-Off Ver
    2010
    Posts
    8

    Re: Copy Pivot Table with the source date to new workbook

    Quote Originally Posted by kev_ View Post
    Is your new code working correctly?
    Yes Kev_
    Please see the file attached with the code.
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copy Pivot Table with the source date to new workbook

    In that case, the only thing I would change is to use the variable wbSt
    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Last edited by kev_; 04-09-2018 at 05:32 AM.

  13. #13
    Registered User
    Join Date
    10-18-2017
    Location
    UAE
    MS-Off Ver
    2010
    Posts
    8

    Re: Copy Pivot Table with the source date to new workbook

    I have changed, thanks. I have the same issue with Slicer also. Let me try, if not succeed , then I wd ask help here again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 06-20-2017, 02:08 AM
  2. Replies: 0
    Last Post: 01-06-2016, 07:00 AM
  3. Export Pivot Table and Source data to another Workbook
    By pintxo_21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-28-2015, 05:50 AM
  4. Replies: 0
    Last Post: 06-05-2015, 02:14 AM
  5. Pivot Table Date Adding 4 Years and 1 day to Source Data Date
    By dhanni in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-05-2014, 02:20 PM
  6. Connecting Pivot Table To Source Data From A Different Workbook
    By bcommando17 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-26-2012, 11:11 AM
  7. [SOLVED] Macro to update pivot item (date format) in pivot table to latest date from data source.
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2012, 03:18 AM

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