+ Reply to Thread
Results 1 to 10 of 10

extract values from multiple worksheets

  1. #1
    Registered User
    Join Date
    11-05-2009
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    12

    extract values from multiple worksheets

    I'm not even sure this is possible but here goes...

    I have several hundred seperate worksheets formatted exactly the same. I want to extract the values from specific cells in every worksheet and build a single worksheet with the values extracted.

    The attached example includes 2 sample source sheets and a sample result sheet.
    Attached Files Attached Files
    Last edited by matt5596; 12-15-2010 at 06:07 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: extract values from multiple worksheets

    this is doable with vba but posted in the programming sum forum will probably give you a better response
    post it here
    http://www.excelforum.com/excel-programming/
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: extract values from multiple worksheets

    Regarding the 100s of worksheets, are they:

    1) in a single workbook
    2) individual sheets saved as individual workbooks (1 per book)
    3) multiple workbooks but each book has multiple sheets
    _________________
    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!)

  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: extract values from multiple worksheets

    Assuming all the sheets are in the same workbook as shown in the example, use this macro:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-05-2009
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: extract values from multiple worksheets

    Quote Originally Posted by JBeaucaire View Post
    Regarding the 100s of worksheets, are they:

    1) in a single workbook
    2) individual sheets saved as individual workbooks (1 per book)
    3) multiple workbooks but each book has multiple sheets
    Sorry for my delayed response. They are individual sheets saved as individual workbooks.

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

    Re: extract values from multiple worksheets

    Edit the fPath variable in this macro to point to your folder. Also edit the filter in the DIR() command if the files are not *.xlsx files.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-05-2009
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: extract values from multiple worksheets

    "Subscript out of range"

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

    Re: extract values from multiple worksheets

    Debug and do a more thorough job reporting the error. Post your edited version of the macro, too, point out the line with the error.

    That error usually means something is spelled wrong, a folder or file or sheet previously defined is now missing...it's looking for something it can't find.

  9. #9
    Registered User
    Join Date
    11-05-2009
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: extract values from multiple worksheets

    I ended up using another macro to combine the sheet I needed from each individual workbook into one workbook and then I used the first macro you posted to get my result worksheet. Works great! Thank you.

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

    Re: extract values from multiple worksheets

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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