+ Reply to Thread
Results 1 to 21 of 21

Macros to consolidate text data from multiple sheets in a workbook into one summary sheet

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Angry Macros to consolidate text data from multiple sheets in a workbook into one summary sheet

    I am attempting to consolidate multiple sheets of text data within the same workbook into a master sheet within the same workbook, automatically. The master sheet is to only pull in those rows that have "false" marked in column D (or have the check box depressed) and I would like to have this happen real time. All of the headers are the same, however the data on each tab is different. I have columns A-J and infinite rows.
    I am more of a novice at macros, so I would need something I could copy paste. Any help would be great as I have been working on this all night and all day for about a week.
    Last edited by JBeaucaire; 10-18-2012 at 03:02 AM.

  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: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    Checking if there is "false" in column D is fine. Which textbox should be depressed?
    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
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    I guess I need help there too...
    We want a yes button/checkbox in column c so if the answer to the question in column B is true or yes, we press it. If the answer is no or false, we press column D and if the question is N/A, we press a button in column E that is N/A or true. For every row, only one button can be pressed or check mark be placed. they have to pick one of the 3 options. Then, the only rows from every sheets that need to roll up into the master summary sheet are those rows where the no box/button is checked in column D.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    The consolidation part is easy enough. Right-click the consilidation sheet tab and selet VIEW CODE, then paste in the event macro:

    Please Login or Register  to view this content.
    Close the editor and save your workbook, make sure it's not .xlsx type or the macro will be erased.

    Now, anytime you bring up the consolidation sheet onscreen, it will clear itself and collect all the updated data from all the other sheets. You'll hear a "beep" to remind you it just happened.

    The macro is applying an Autofilter on row1 of each sheet and filtering column D for "false" then copying all visible rows at once.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    thank you. Now I am a bit confused by the last statement
    "The macro is applying an Autofilter on row1 of each sheet and filtering column D for "false" then copying all visible rows at once. "
    Does this mean that the macro will only look at row 1 one each tab? Or will it look through the infinite rows of data and pull in to the consolidated sheet, based on the results of column D?

    Also,
    would there be a way to have a button placed somewhere that stays within the workbook and when my team members are ready to run the consolidation report, they would just have to press the button and a new consolidation sheet would appear?

  6. #6
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    HMMM...I am getting an error.
    Since this morning, I could not get the true/false option buttons to work properly, so I ended up wrtiting a formula that flips the data in Column D between yes and no, based on a condition in column G.
    Does this impact the code that was written?

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    An autofilter is IN row1 (the controls) and the parameters set would apply all the way down contiguous data in the columns where the parameters were applied. So, the Autofilter in D1 is set to "False" causing all the rows that DON'T have "False" in column D to be hidden. Then all visible rows are copied as a group.

    I do not see any benefit to a "button" the creates the consolidation. This macro goes INTO the Consolidation Sheet module and thus runs itself each time you "look" at the sheet. How is a button better than that?

    You are continuing to add questions regarding a "theoretical" sheet, so I gave you a theoretical macro. It should work. Install and try it, and if it errors, DEBUG and tell me where it's a problem. Is it "FALSE" or "false" or "False"? It might matter, try editing the macro accordingly.

    Even better, post a smaller version of your exact workbook and let's look at it together, speed this whole process up.

    Click GO ADVANCED and use the paperclip icon to post your sample workbook.

  8. #8
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    I understand more now. Thank you for the clarification.

    I have done as stated and inserted the code, however it is only pulling from one sheet and it is pulling in data that is marked as "YES" in column D. I only want the rows marked "NO".
    The formula I have incolumn D that flips from YES to NO is:
    =IF($G2,Sheet1!$A$3,Sheet1!$A$4)
    Which says if there is a date in column G, then NO, if there is not a date in column G then YES.

    How can I adjust the code you provided to run across all 7 of my tabs and pull in the "no's" only? All of the tabs are named differently, I am not sure if that matters.
    I also have 1 tab (Sheet1) that is locked, however I do not need any data from that tab.

  9. #9
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    Also,
    When I debugged the code, I get an error at:
    .Rows(1).AutoFilter

    and I also get a pop up that the macro will not work on a protected sheet

  10. #10
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    This is what I changed the code to for my sheets, but I get a compile error that the "NO" variable in the top line is not defined:

    Please Login or Register  to view this content.
    Last edited by Cutter; 10-18-2012 at 05:09 PM. Reason: Added code tags

  11. #11
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    In an attempt to help the situation, I changed the formula in Column D to:
    =IF($G2>0, "NO", (IF($F2="N/A", "----", "YES")))
    This now does exactly what I watn it to do.

    I also realized that with my IF statement, my "NO" is based on a True condition and my YES is based on a False condition.
    I then attempted to adjust the macros to the following:

    Please Login or Register  to view this content.


    I then get an error:

    Run-time Error '1004':
    " The code could not be completed using the range specified. Select a single cell within the range and try the command again."

    I press debug and I am directed to the following line:
    .Rows(1).AutoFilter
    Last edited by Cutter; 10-18-2012 at 05:10 PM. Reason: Added code tags

  12. #12
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    Lastly, I ended up unlocking the one sheet and just simply hiding it from view.
    but that was done prior to the above post.

  13. #13
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to conciliate text data from multiple sheets in a workbook into one summary she

    Here is a small sample verison of my workbook.
    As stated, Maybe this will help.
    SAMPLE WORKBOOK-2.xlsm
    Last edited by tbrice; 10-18-2012 at 01:25 PM. Reason: wrong work book initialy

  14. #14
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    @ tbrice

    Welcome to the forum.

    Please notice that [CODE] tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at the top of the page and read Rule #3.
    Thanks.

  15. #15
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    As your workbook develops, you may need to abandon old design choices in favor or standardization which allows powerful functions like the AutoFilter to work. Autofilter works on a contiguous table of data. Many of your sheets have those black blank rows in them, that breaks the continuity of the data and the autofilter only "filters" the first group.

    So, in the attached, I've removed the blank rows. I've also corrected your errors in the ScreenUpdating references, you reversed them.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    I see, thank you. We are getting there.
    I have deleted the blank rows and added the code to the last sheet.

    The problem now is that in both the sample workbook as well as the real workbook, the macro is skipping over 4 tabs that have "NO"" in Column D and the other tabs it is recognizing, is only pulling in part of the data.
    Even when I tested the sample workbook and made a change to "NO" on the second line of the first tab, and saved the document, the change was not recognized when I clicked the tab to run the macro.

  17. #17
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    Actually, I only need the Column A in the individual Tabs, the summary tab does not need to pull in Column A

  18. #18
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    I changed the code to remove column A and work from Column B and that solved the problem!
    THANK YOU!!!!!!!!!!!!!!!

  19. #19
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    If that resolves the issue, please select Thread Tools from the menu above and mark the thread as solved. Thanks.

  20. #20
    Registered User
    Join Date
    10-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    One question:
    Will this only run on a computer?
    We want to use it in the field on an iPad via the excel app.

  21. #21
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macros to consolidate text data from multiple sheets in a workbook into one summary sh

    That's a completely unrelated topic, your Apple platform. This thread is complete.

    That does sound like a question you could answer for yourself with a 30 second test. I don't use Apple products, so cannot advise you in advance.

+ 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