Forum Discussion

Soran0311's avatar
Soran0311
Copper Contributor
May 20, 2021
Solved

VBA code to find matching data in other sheets

Hello everyone,   I would like to know how to code a macro for searching partial data match in other sheet (or other workbook).   For example : <If current sheet name (or string of cell A1) is (p...
  • mathetes's avatar
    mathetes
    May 21, 2021

    Soran0311 

     

    May  ask, now that I've seen the sample, why there are more than 200 sheets in each of which cell L8 needs to be filled with that address data from the database sheet?

     

    I don't mean to be impertinent in asking. There may be entirely legitimate reasons, and if so perhaps a macro is indeed the solution. I'm not a macro person; I am more of a design person who strives to use Excel with its built-in functions, often finding that there are far more elegant solutions than (what I will refer to as) the "brute force" of a macro.

     

    So in this case, where all of the subsequent sheets are exactly the same format, it makes me wonder whether they could all be consolidated into:

    • another single database, where it would be easy (as you note) to write a simple LOOKUP function for the data to be retrieved from the address database, PLUS
    • a nicely formatted "dashboard" that mimics the layout you have on each of these individual sheets now

    As I said, there may be a reason why that can't be done, but I view part of my (volunteer) job here in the techcommunity to raise such questions about design rather than simply give answers, where I think such questions are warranted.

Resources