+ Reply to Thread
Results 1 to 5 of 5

Search worksheets for values that matches a cell and add different value to offset cells.

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2007
    Posts
    53

    Search worksheets for values that matches a cell and add different value to offset cells.

    Hello, need a Macro to search a whole workbook or a large number of sheets for cells matching a value from a particular cell and then add a different value from the cell to the right of the particular cell into all the cells to the right of the found cells (if empty) from all the worksheets. There could be anything from 1 match to 100! The search could be limited to a particular column from each worksheet, but I currently have 250 worksheets within this particular workbook. Hope someone can help, dont know where to start, im ok at amending code once infront of me, but have never actually written any!
    An example:
    A number (eg 123) would be entered into sheet1 A1 and another number entered into sheet1 B1. When Macro is run (button), need to search all other worksheets (eg sheet2 to sheet250), potentially the same column in each one (Lets say column E), for the value in A1, if it finds a match to Sheet1 A1 (123) then it needs to add the value from Sheet1 B1 into the cell that is to the right of the match (eg. match in sheet50, E25. Add B1 value to sheet50 F25). As mentioned above, there could be matches in a number of sheets, the value in B1 would need to be added to the right of all these matches.
    Hope Im not asking to much!!

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520
    Can you upload the workbook? I don't what you mean by can be limited to one column.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    08-12-2009
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Search worksheets for values that matches a cell and add different value to offset cel

    Hi Mike, thanks for the reply. All I mean is that the search doesnt have to be of the whole worksheet. It could just search Column E of each worksheet. The matches to Sheet1 A1 in the example above will all be found in the same column (E) on every worksheet. So, although I need it to find matches to the value from sheet1 A1 in all other sheets of the workbook, each worksheet has the same layout, so the data to find will be in the same column. Hope this makes sense?

  4. #4
    Registered User
    Join Date
    08-12-2009
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Search worksheets for values that matches a cell and add different value to offset cel

    Right, with the help of rondebruin, I have made a start. But still need help fine tunning it.
    Please Login or Register  to view this content.
    How do I change the search criteria? Need to search for more values, but cant seem to get it to work e.g.
    from this:
    Please Login or Register  to view this content.
    To this:
    Please Login or Register  to view this content.
    Maybe?
    Also it searches for blank cells at the moment, how do I stop this?

  5. #5
    Registered User
    Join Date
    08-12-2009
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Search worksheets for values that matches a cell and add different value to offset cel

    Also, forgot, at the minute it only searches one sheet? Cant seem to amend this for multiple sheets. e.g.
    From this:
    Please Login or Register  to view this content.
    To this maybe?:
    Please Login or Register  to view this content.
    Or:
    Please Login or Register  to view this content.
    Someone Please help! My Vba is rubbish, but im really trying on this one

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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