Closed Thread
Results 1 to 10 of 10

Extract cell value from multiple worksheets onto a new worksheet.

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

    Extract cell value from multiple worksheets onto a new worksheet.

    Hi,

    Can anybody teach me how to copy data from multiple worksheets, to a new worksheet? I need the same cell from each worksheet. For example, i have 300 worksheets, i need to copy each data value in each b4 cell from each sheet onto the 301st worksheet, and have each data value one after the other in the format of a column.

    is this possible??

    Omar

  2. #2
    Registered User
    Join Date
    03-27-2009
    Location
    Boston, United States
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Extract cell value from multiple worksheets onto a new worksheet.

    This is possible using VBA - are you familiar with VBA for Excel, or are you looking for a non-macro way to do this?

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

    Re: Extract cell value from multiple worksheets onto a new worksheet.

    see here you need to copy all the code into a new module
    http://msdn.microsoft.com/en-us/library/cc793964.aspx
    read the comments
    relevent ones you may like to change are
    Specify the range to place the data. Set CopyRng = sh.Range("A1:G1")
    so change to your cell here

    ' Optional: This statement will copy the sheet
    ' name in the H column.

    DestSh.Cells(Last + 1, "H").Resize(CopyRng.Rows.Count).Value = sh.Name

    delete this bit if not needed
    "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

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Extract cell value from multiple worksheets onto a new worksheet.

    Not knowing the specifics of how your sheets are named, you might try adapting this bit of code which assumes the very last sheet is the intended target sheet to receive the data. I assumed sheets are named "sheet1, Sheet225, etc.)

    Cell B4 in the other sheets with be copied down column-A of the last sheet.

    Please Login or Register  to view this content.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    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 cell value from multiple worksheets onto a new worksheet.

    If the sheet names are all sequentially numbered (Sheet1, Sheet2, Sheet3, etc....or something as consistent as that), then you can do this with a formula, too. A volatile function called INDIRECT() would work.

    On the 301st sheet, you could enter this formula anywhere and copy it down 300 cells:

    =INDIRECT("Sheet" & ROWS($1:1) & "!B4")
    _________________
    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!)

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

    Re: Extract cell value from multiple worksheets onto a new worksheet.

    Thank you very much, the formula worked like a treat.

    Omar

  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: Extract cell value from multiple worksheets onto a new worksheet.

    If your sheetnames ever become NOT that sequential or easy, you can change the indirect() formula to draw the sheet name from an adjacent cell where you've listed off your sheetnames. For instance if your sheet names are in column B starting at B2, you could put this in C2 and copy down:

    =INDIRECT("'" & B2 & "'!B4")

    Notice this is a *tiny* bit different with red apostrophes added, this is to make sure the references created still work if your sheet names happen to be more than one word.

    ===============
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

  8. #8
    Registered User
    Join Date
    12-26-2015
    Location
    New Jersy
    MS-Off Ver
    2007
    Posts
    10

    Re: Extract cell value from multiple worksheets onto a new worksheet.

    This formula works but also brings in blanks from sheets that have a blank in that cell. How can I have it skip those sheets with blanks?

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Extract cell value from multiple worksheets onto a new worksheet.

    dmkolb welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Registered User
    Join Date
    12-26-2015
    Location
    New Jersy
    MS-Off Ver
    2007
    Posts
    10

    Re: Extract cell value from multiple worksheets onto a new worksheet.

    Sorry I just started a new post.

Closed 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