+ Reply to Thread
Results 1 to 16 of 16

Code to copy a row from multiple sheets to a summary sheet per criteria

  1. #1
    Registered User
    Join Date
    01-29-2014
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    10

    Code to copy a row from multiple sheets to a summary sheet per criteria

    Hello,
    I need some help with some code to copy a row of data from multiple tabs to a summary tab. What I have is a worksheet with several tabs, all formatted the same, in column G, there is a calculation of the number of days a case has been open, when that data gets to be >90, I need that row, column A to I to copy to the next empty row on the "Summary" tab. I have looked on here and found some similar scenarios, but none seem to work for what I want. Any help will be appreciated. Thanks

  2. #2
    Forum Contributor
    Join Date
    07-18-2012
    Location
    New York
    MS-Off Ver
    2016
    Posts
    193

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    I just posted this for someone else with a very similar issue. There's probably another way to do what you're asking but this will basically merge all sheets to one and then sort Descending by column G. You'd then just have to delete everything else that you don't want which I'm sure there's a way to add to the macro.


    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Assuming you have headers in row 1:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-29-2014
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Thanks for the help, but I get a "Run-Time error 1004" code.

    Sub Consolidate_90Days()
    Dim wsSum As Worksheet: Set wsSum = Sheets("Summary") 'make sure this matches your summary sheet name
    Dim ws As Worksheet

    The sheet name is "Summary"; How exactly do I need the second line of code to be? Do I need to change any other lines? Sorry for the questions, but I am new to coding and trying to work my way thru it.
    Last edited by rmwindham; 08-28-2014 at 06:10 PM.

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Is there a trailing space at the end of your sheet name? "Summary "?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  6. #6
    Registered User
    Join Date
    01-29-2014
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    No there isn't

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    I could not replicate the problem. Can you attach your workbook?

  8. #8
    Registered User
    Join Date
    01-29-2014
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Sure, here it is and thanks

  9. #9
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    No workbook attached

  10. #10
    Registered User
    Join Date
    01-29-2014
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    How about now? It shows in Go Advanced, manage attachments. Am I doing it correctly?

  11. #11
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Nope. You probably need to click the insert inline or done button after you select the workbook. You will be able to see it in your post when you do

  12. #12
    Registered User
    Join Date
    01-29-2014
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Now Attached
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    01-29-2014
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Wrong file, last one had no sample data, this one has data
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Sheet name needs to match.

    But that is not going to be your only issue.

  15. #15
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Please also note that your columns in the summary sheet do not line up with the others sheets. You will need to add a column A

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    01-29-2014
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Code to copy a row from multiple sheets to a summary sheet per criteria

    Thanks very much. There is a Column A, it is hidden on the data pages. Only need it to show on the Summary page. Your code is very close, but shows some rows that are less than 90 days and doesn't show all of the rows that are over 90 days. I will tinker with it. Thanks again

+ 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: 2
    Last Post: 10-08-2013, 02:58 PM
  2. MACRO to copy cells from multiple sheets into a summary sheet
    By andrewtmliu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-02-2013, 10:48 PM
  3. [SOLVED] Summary sheet - copy cell contents from multiple sheets to one summary sheet
    By jsmity in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 10:32 AM
  4. macro to copy column A from multiple sheets onto summary sheet
    By fabrecass in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2012, 05:46 PM
  5. find value in multiple sheets, copy offset and paste to summary sheet
    By Pholic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-02-2011, 12:23 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