+ Reply to Thread
Results 1 to 2 of 2

Search workbook with many sheets for a value then pull that value into a cell in a new she

  1. #1
    Registered User
    Join Date
    08-13-2019
    Location
    Denver, Colorado
    MS-Off Ver
    office for mac
    Posts
    1

    Search workbook with many sheets for a value then pull that value into a cell in a new she

    I need very non-technical instructions on how to search every sheet in the same workbook (29 tabs) for the value in my current sheet (B2) find it on one of the 29 tabs, then pull the value from that sheet (B11) and the data from the range of cell on the same row (C11:G11) into the cell on my new worksheet (sheet 7, cell G2).

    I have tried 4 VBAs and they havent worked. I cant get one macro to run. I could be doing it all wrong, but with a very basic understanding of these functions, I am sure I just not replacing the correct data from the sample formulas.

    Thanks in advance for your help!

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Search workbook with many sheets for a value then pull that value into a cell in a new

    You can use the 'Find' method to search your sheets and then return columns B:G of that row on that sheet like this.
    Please Login or Register  to view this content.
    This code follows, as best possible, the criteria outlined in the OP. I question Sheet7 being the new sheet when there are already 29 sheets, but it is possible. I also question the validity of copying cell B11 plus cells(C:G) of that row and pasting to G2 on the destination sheet. At any rate, the code does the following:
    1.puts the crfiteria sheet with cell B2 data in a variable.
    2.Uses a For Next loop to check each sheet in the workbook, except the criteria sheet and sheet 7.
    3.Uses the Find method to search for the B2 criteria on each of the other sheets.
    4.If the B2 criteria is found, it copies the range B:G on that row and pastes values only to sheet 7, at cell G2.
    5,If the value was found, it will exit the for loop without checking any other sheets.

    Comments:
    If the criteria value in B2 is only located in a specific column of the other sheets, that should have been specified since the code will otherwise check each cell of all the data on each sheet and that extends to run time of the macro considerably. The code was tested on a mock up and ran without error.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

+ 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: 1
    Last Post: 01-26-2017, 02:57 PM
  2. Replies: 5
    Last Post: 05-17-2016, 02:35 PM
  3. Search worksheet in another workbook and pull matching Data
    By erjp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-28-2015, 05:06 AM
  4. [SOLVED] how to create a search engine on one sheet to pull results from other sheets
    By vickyp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-12-2013, 03:59 PM
  5. Replies: 3
    Last Post: 02-07-2013, 05:15 AM
  6. [SOLVED] Search row and pull column number involving seperate sheets
    By Jon.R in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2013, 04:41 PM
  7. userform that will search name and pull results from a seperate workbook
    By Sway1978 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-26-2012, 07:56 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