+ Reply to Thread
Results 1 to 10 of 10

Macro to extract data from multiple worksheets into one mastersheet

  1. #1
    Registered User
    Join Date
    04-01-2013
    Location
    Northeast, US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Macro to extract data from multiple worksheets into one mastersheet

    I would like to create a macro that would pull all the data from multiple worksheets (1-4) and put it onto a mastersheet ("SummaryPage"). However, I only require rows which have a "1" in the "Priority" column (D).

    Can this be done?

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Macro to extract data from multiple worksheets into one mastersheet

    Try the below code.....

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macro to extract data from multiple worksheets into one mastersheet

    Hi, :) Sixthsense :),

    didnīt try the code but shouldnīt it be
    Please Login or Register  to view this content.
    for a new row instead of overwriting the last row with
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Macro to extract data from multiple worksheets into one mastersheet

    The below line is resetting the value of x, so the data won't get replaced, I believe

    Please Login or Register  to view this content.
    Please correct me if I am wrong

    Thanks for the input

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macro to extract data from multiple worksheets into one mastersheet

    Hi, :) Sixthsense :)

    so the data won't get replaced, I believe
    This will get the last visible row of data, for copying either Offset or the number of lines to do so should be inserted. Thatīs what a test with the command shows in the Immediate window.

    Ciao,
    Holger

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Macro to extract data from multiple worksheets into one mastersheet

    Yeah you are right exactly

    That code was written in the beginning stage and offered long back ago and I am keeping folders for similar threads and I am just doing copy paste of my older code's with minor change to suit the OP's data. So I missed to see that part.

    Thanks for correcting it

  7. #7
    Registered User
    Join Date
    04-01-2013
    Location
    Northeast, US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to extract data from multiple worksheets into one mastersheet

    Quote Originally Posted by :) Sixthsense :) View Post
    Try the below code.....

    Please Login or Register  to view this content.



    Thank you! This is exactly what is needed. However, using "Set rMyRng = wNew.Range("B" & x) + 1" in place of "Set rMyRng = wNew.Range("B" & x)" only pulls the rows with a "1" in the "Priority" column (D) from sheet "2" only.

    Could the rows that have a "1" in the "Priority" column (D) from all sheets (1-4) be pulled?

    Thank you!

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macro to extract data from multiple worksheets into one mastersheet

    Hi, mjwmgmt,

    the code must read (sorry for spreading confusion on that with a wrong code)
    Please Login or Register  to view this content.
    Ciao,
    Holger

  9. #9
    Registered User
    Join Date
    04-01-2013
    Location
    Northeast, US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to extract data from multiple worksheets into one mastersheet

    Hi HaHoBe,

    Now I don't see anything on the "SummaryPage". Here is what I have currently:

    Please Login or Register  to view this content.

  10. #10
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macro to extract data from multiple worksheets into one mastersheet

    Hi, mjwmgmt,

    maybe give this altered code a try:
    Please Login or Register  to view this content.
    Ciao,
    Holger

+ 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