+ Reply to Thread
Results 1 to 4 of 4

Add contents from different workbooks to the Mastersheet

  1. #1
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    Add contents from different workbooks to the Mastersheet

    I have been trying to add the contents from the cells in various workbooks based on the month. Each of the workbook is named Mastersheet-21-Jul-17 (the underlined date corresponds to the last Friday which I get by running a macro that adds the date of last Friday after Mastersheet). So I’ll be having about 4 such sheets every month. Each workbook will have only 1 sheet. Could you please suggest a way where, when I select the month from combobox, all the files corresponding to that month will have their contents added and pasted to the Monthsheet?

    Could the same be then added again say in months of 4? Eg: Monthsheet-Jan, Monthsheet-Feb, Monthsheet-Mar, Monthsheet-Apr together to form Grp1?

    The addition needs to be performed on cells C4:AB50

    For Example:

    If Cell C4 in MasterSheet-21-Jul-17 contains 12 and Cell C4 in MasterSheet-28-Jul-17 contains 10 then cell C4 in Monthsheet should contain 22. Similarly for other cells across all the workbooks for that month.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Add contents from different workbooks to the Mastersheet

    Hi chunkyp,

    This problem is a Power Query problem. You can append many workbooks into a single workbook using it. Power Query is an Add-In to 2010 and 2013 Excel and standard in 2016 Excel (renamed to Get & Transform).
    https://www.youtube.com/watch?v=QZXB9dB8SlA
    http://excelunplugged.com/2015/02/10...n-power-query/
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    Re: Add contents from different workbooks to the Mastersheet

    Hi MarvinP,

    By adding, I mean I want the sum for the cells. Power Query will append all the data from the files to my Monthsheet one after another. That is not what I wanted in here.

    But what I wanted was the sum of Cell C4 from Mastersheet-7-Jul-17, Mastersheet-14-Jul-17, Mastersheet-21-Jul-17, Mastersheet-28-Jul-17 reflected on cell C4 of Monthsheet when I have selected the month of July in Combobox1. Similarly for other cells in the range of C4:AB50.

    Eg: Cell F8 in Mastersheet-7-Jul-17 contains: 8
    Cell F8 in Mastersheet-14-Jul-17 contains: 12
    Cell F8 in Mastersheet-21-Jul-17 contains: 3
    Cell F8 in Mastersheet-28-Jul-17 contains: 30

    Then when I run the macro present in Monthsheet by selecting the month, the cell F8 in MonthSheet should have the value of 53.

    The reason I'm after macro is that there are several other macros running in here, so I can run them one after another.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Add contents from different workbooks to the Mastersheet

    Hi chunkyp,

    I'm sorry I didn't understand the question. The topic is called 3D Sums if you had your 4 months on different sheets in the same workbook.

    http://www.excel-exercise.com/function/3d/

    Your problem is 3D across workbooks instead of worksheets.

    I think your answer lies in the ability to "Paste Special Add". You can open a workbook and select a range of cells and then press Ctrl-C. This will copy their contents into the windows buffer. Then you would select the master workbook and click on the top left cell of the paste range and "Paste Special" but click on the "Add" radio button in the dialog. This will paste using addition over the cells on the master. I think this is "the way" you need to do your problem.

    Do your problem by hand a few times using this "Paste Special Add" and then record a macro that does what you want. Look at the macro to decide how to use the "month dropdown" to open the correct files. I think this is what you are looking for.

    http://www.techrepublic.com/blog/mic...ting-in-excel/

+ 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. Split data from MasterSheet into multiple (preformatted) workBOOKS
    By KT99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2014, 10:24 AM
  2. Macro to extract certain rows based on contents of A:A and add them to new workbooks
    By Ethanrholt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2014, 02:47 AM
  3. help with macro with if statements that will print workbooks according to cell contents.
    By scottatbuckman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2014, 12:51 PM
  4. Feeding a mastersheet
    By Tunahunter in forum Excel General
    Replies: 1
    Last Post: 03-17-2014, 01:30 AM
  5. Need a macro code to split worksheets into workbooks with contents breakup.
    By Adish in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-23-2013, 02:46 AM
  6. [SOLVED] Worksheets (1 x worksheet in 5 different workbooks) combined into one 'mastersheet'
    By Nat Barnes in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-18-2012, 09:57 AM
  7. [SOLVED] Combine contents of multiple workbooks into one worksheet
    By EMG03 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-24-2005, 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