+ Reply to Thread
Results 1 to 6 of 6

copy pivot table data to next available sheet in a certain workbook

  1. #1
    Registered User
    Join Date
    02-29-2012
    Location
    baltimore,md
    MS-Off Ver
    Excel 2007
    Posts
    7

    Red face copy pivot table data to next available sheet in a certain workbook

    So here is my code:
    Please Login or Register  to view this content.
    In "Template1.xlsm" a quantity is entered into column H on the Inventory Sheet. The code above is assigned to a button called "Run Report", which copies a pivot table from one workbook (template1.xlsm) and places it into a new workbook on sheet1 in A2. These pivot table are going to be created at the least, once a week. There are also going to be numerous pivot tables for numerous job numbers. For example, Job# 10022 consists of 40 pivot tables, Job# 10023 consists of 10 pivot tables,etc. Id like to use the code above or any other to do this:

    When Button (Run Report) is clicked i want the pivot table copied to a new sheet in a new workbook (I have that down). With the code above I have the option to save and close this new file with a certain job# ie 10011.xlsm. The next day the Template1.xlsm file is opened and more data needs to be entered into that job. Instead of clicking "Run Report" and having a new workbook created i want the data copied to that same file (10011.xlsm), but to a new sheet. These xlsm files will be stored in a Job Transfers folder on our server.

    Here are my thoughts. In the Template1.xlsm file i have 2 sheets, "Inventory" and "Report". I want to create a cell on the "Inventory" sheet that i can enter a job number in, say N1. When "Run Report" is clicked the report is ran, excel recognizes if that job number.xlsm file has been created if true, insert the copied data to the next available sheet/prompt to rename the sheet/save and close. If false, insert the copied data into the first sheet of a new workbook/prompt to rename the sheet/save as (job number entered in N1 on Inventory sheet) and close. I have been searching and searching for weeks now to try to get this done. This seems like alot of work and I just hope someone can help me.

    Thanks in advance!

    I tried attaching my file but its about 5mb. sorry
    Attached Files Attached Files
    Last edited by bsigmon1103; 03-08-2012 at 10:08 AM. Reason: To post the attachment

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy pivot table data to next available sheet in a certain workbook

    It would be good if you attach a sample file. Do no attach the original. If the sample file is too huge (due to the pivot), then zip it.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    02-29-2012
    Location
    baltimore,md
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: copy pivot table data to next available sheet in a certain workbook

    So i found out why my file was so large. I had a hidden sheet i forgot about. I deleted it and bam! Posted the file on the post above.

  4. #4
    Registered User
    Join Date
    02-29-2012
    Location
    baltimore,md
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: copy pivot table data to next available sheet in a certain workbook

    Hopefully someone can help me.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy pivot table data to next available sheet in a certain workbook

    This is a huge task which i suggest you break up into small manageable bits and then post questions accordingly. No one might be ready to do the whole project for you in one chunk as they wont have that much time. But if you break it into chunks, it can be easily handled.

  6. #6
    Forum Contributor
    Join Date
    04-03-2011
    Location
    India
    MS-Off Ver
    Excel 2015
    Posts
    122

    Re: copy pivot table data to next available sheet in a certain workbook

    will try something

+ 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