+ Reply to Thread
Results 1 to 4 of 4

Copy data from multiple sheets to a consolidated sheet.

  1. #1
    Registered User
    Join Date
    06-15-2010
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    10

    Copy data from multiple sheets to a consolidated sheet.

    Did a preview of the post before I posted it and it forced me to enter text, I am therefore entering the original messgae that I had typed.

    I am wondering if you experts can help with the following.

    I have a workbook that records weekly Income and Expenses.

    Each workbook consists of 4 or 5 sheets that record Income and Expenses that makes up the month.

    There are also sheets named Monthly Totals, Monthly Receipt No, Lookup and Formula which should be excluded from any processing as they do not contain data that needs to be copied.

    All Income for a week is recorded in Cell A1 to V33 in the appropriate weekly sheet.

    All Expenses for a week is recorded in Cell A39 to V59 (Total of 21 rows) in the appropriate weekly sheet. Row 60 in the individual Sheets is a Total Line which has the word “TOTAL (B)” in D60.

    The workbook is a Macro Enabled and is created by using a Templated and running macro.

    Is it possible to have all Expenses rows that have input in Sheet1 thru Sheet5 copied to sheet called Month Expenses? Month Expenses has headings in Rows 1 thru 3 and the Sheet will always exist.

    Example

    If Sheet1 has data in rows 39 and 40, Sheet2 has data in rows 39 to 46, Sheet3 has no data in rows 39 to 59, Sheet4 has data in only row 39 and Sheet5 has data in rows 39 to 65 (this allows for the User to insert extra lines for Expenses as and when required).

    Proposed Solution

    Sheet called Monthly Expenses to have data from Sheet1, rows 39 and 40, data from Sheet2 rows 39 to 46, nothing from Sheet3 as it has no input, data from Sheet4 row 39 and finally data from Sheet5 rows 39 to 65

    Row 60 in the individual Sheets is a Total Line which has the word “TOTAL” in D60. This might assist in identifying the range.

    I have populated sheet named Month Expenses as this should help to work out what the final outcome will be.

    Cells C39 to C59, H39 to H59 and I39 to I59 (H and I are merged Cells) have Dropdowns.

    Sheet called Month Expenses, E3, F3 and G3 contains a formula that should be changed to SUM from E4 to the last row of data in Column A. Same for columns F and G.

    Lastly, the print area should be set to A1 V Last Row and the sheet to be print on 1 page.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: Copy data from multiple sheets to a consolidated sheet.

    Check if it works according to your assumptions.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Best Regards,
    Maras.

  3. #3
    Registered User
    Join Date
    06-15-2010
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Copy data from multiple sheets to a consolidated sheet.

    Maras.

    Firstly, many thanks for taking the time to look at the problem I had identified.

    A quick test shows that it warks as expected.

    I have a funeral to attend to today, and therefore cannot spend further time to test your proposed solution (I am sure it will be work).

    I will test it out with more data tomorrow and report back.

    Once again thank you for your time.

    Regards

    Kayslover

  4. #4
    Registered User
    Join Date
    06-15-2010
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Copy data from multiple sheets to a consolidated sheet.

    Maras,

    I have managed to test your code and as expected it works a treat, so thank you very much for that.

    Is there any way that the macro code can be changed so that it doesn’t reference Sheet1, Sheet2.. Sheet5.

    My template creates the sheets as Sheet1, Sheet2…Sheet5. It then renames them to a date in the format dd-mmm-yy (i.e. Sheet1 becomes 03-Jan-21, Sheet2 becomes 10-Jan-21, Sheet3 becomes 17-Jan-21, Sheet4 becomes 24-Jan-21 and Sheet5 becomes 31-Jan-21). Obviously these change for each month of the calendar.

    Can the code be changed to NOT process sheets called “Monthly Totals”, “Monthly Receipt No”, “Month Expenses (this is the consolidation sheet)”, “Lookup” and “Formula”.

    These sheets do not contain data that requires consolidation, and the template creates these for every month in the year and therefore they will always exist.

    This will also allow for processing data sheets that really have the data that I need consolidating and it will also cater for the fact that certain months will have 4 weeks (i.e. Sheet1 to Sheet4, which will be renamed) and certain month will have 5 weeks (i.e. Sheet1 to Sheet5, which will be renamed).

    Lastly, I have the print area set to A1 to V38 in sheet called Month Expenses. Can this be changed by the macro to set the Print Area from A1 to the Last row that has data, and forced to fit on 1 page.

    Your assistance will be apprecaited.

    Kayslover
    Last edited by kayslover; 01-27-2021 at 08:50 AM. Reason: Make Corrections to text

+ 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: 6
    Last Post: 08-30-2020, 03:51 PM
  2. [SOLVED] Consolidated Summary Sheet - Copy data from one sheet to other based on criteria
    By sabha in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-21-2015, 03:29 AM
  3. [SOLVED] Copy Data from one sheet and paste the consolidated data into another (Data Range Varies)
    By kittu55 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-13-2013, 10:02 PM
  4. [SOLVED] Macro to consolidated all data from different sheets to summary sheet in the same workbook
    By rochakmehta90 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-17-2013, 03:10 AM
  5. [SOLVED] Create consolidated dynamic sheet from several sheets (pull data)
    By G.Bregvadze in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-23-2013, 03:27 PM
  6. Copy non-sequential columns with headers (from multiple sheets) to one consolidated sheet
    By constantmallee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2012, 02:24 PM
  7. Copy data from multiple workbooks into consolidated/master workbook
    By mobro1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2012, 02:42 PM

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