+ Reply to Thread
Results 1 to 8 of 8

Copy Data to another worksheet with dynamic rows

  1. #1
    Registered User
    Join Date
    07-14-2017
    Location
    Jacksonville
    MS-Off Ver
    2016
    Posts
    8

    Question Copy Data to another worksheet with dynamic rows

    Hi!

    Each month, I have to copy the sales report to a consolidated report, and the number of rows of data for each month is different. On the consolidated worksheet, there is a pivot table at the bottom of the page. So I am wondering which formula should I use to make sure there's enough rows to contain the new data, and the old data can be deleted automatically. Also, the pivot table can calculate the data with the new range.

    For right now, i have to manually check the rows to make sure the new data don't cover the place where the pivot table is, and also change the source of the pivot table every time to make sure the calculation is correct. Thank you!

  2. #2
    Valued Forum Contributor
    Join Date
    03-16-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    371

    Re: Copy Data to another worksheet with dynamic rows

    When you paste your monthly data into the consolidated report, do you want all previous data to be deleted?
    Or is there some criteria (date etc.) that determines which data is to be deleted?

  3. #3
    Registered User
    Join Date
    07-14-2017
    Location
    Jacksonville
    MS-Off Ver
    2016
    Posts
    8

    Re: Copy Data to another worksheet with dynamic rows

    Basically all data from last month need to be deleted, the last column is a vlookup that I don't want to delete the formula. But I also need auto adjust the row so the vlookup will catch all the new data. Thank you!

  4. #4
    Valued Forum Contributor
    Join Date
    03-16-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    371

    Re: Copy Data to another worksheet with dynamic rows

    Ok, it's possible. Could you attach a sample (de-sensitised) workbook please so that I can write the code.
    On your reply click "Go Advanced" then scroll down to "Manage Attachments" to add an attachment.

  5. #5
    Registered User
    Join Date
    07-14-2017
    Location
    Jacksonville
    MS-Off Ver
    2016
    Posts
    8

    Re: Copy Data to another worksheet with dynamic rows

    I have attached a sample excel spreadsheet for you to write code on. Thank you!
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    03-16-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    371

    Re: Copy Data to another worksheet with dynamic rows

    Had a bit of time to give this a go today. Make a new sheet called "NewData" and paste your new information into there in cell A1 onwards (with no headers).
    Then try the following code:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-14-2017
    Location
    Jacksonville
    MS-Off Ver
    2016
    Posts
    8

    Re: Copy Data to another worksheet with dynamic rows

    Thank you for your help!

  8. #8
    Valued Forum Contributor
    Join Date
    03-16-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    371

    Re: Copy Data to another worksheet with dynamic rows

    My pleasure to help

    If that takes care of your original question, please select Thread Tools from the menu link above to mark this thread as SOLVED.
    To say thanks to the user(s) who contributed towards the solution, you can use the "Add Reputation" button on their helpful post(s).
    Thanks!

+ 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. [SOLVED] VBA Code to copy data from dynamic list of worksheet names into summary sheet
    By dt_org in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-21-2014, 10:03 AM
  2. Need help with macro copying data from different worksheet,rows are dynamic
    By rsj1977 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-21-2014, 04:18 PM
  3. Automatically copy to new rows to new rows as raw data is added on another worksheet
    By lanoushi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-12-2013, 09:03 AM
  4. Copy and Pasting dynamic data into blank rows and of another sheet
    By Lisa4legin in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-18-2013, 07:49 PM
  5. [SOLVED] Maco 2 Copy dynamic data from multiple worksheets into Summary worksheet in same workbook
    By abrennan in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-16-2012, 03:40 AM
  6. [SOLVED] Copy rows from my main worksheet to another worksheet based on data in one cell
    By gcol in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-08-2012, 05:12 AM
  7. Copy dynamic data from worksheet to another identifying by the name of worksheet
    By c.wang in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2009, 08:05 PM

Tags for this Thread

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