+ Reply to Thread
Results 1 to 11 of 11

Multi-Search Code

  1. #1
    Registered User
    Join Date
    11-05-2014
    Location
    SF
    MS-Off Ver
    Excel 2010
    Posts
    39

    Multi-Search Code

    Hey guys, I have a request, and I'm planning on putting it on Commercial Services forum. I want to get an idea of what is a fair price to award for completion.

    I have a master tab. It has 15 columns. Each column pulls data from other tabs. I need a search button that allows users to search for one of 5 columns.

    Once the 5 columns have been searched, each match should populate with all the info that corresponds to that ID (the rest of the row).

    Then, and here's the hard part, I need the search function to comb through 3 of those columns and find any new matches to the original matches. Essentially, it goes like this:

    Example: James (column 1), who is 21 years old (column 2), is green (column 3), and loves pizza (column 4).

    I only know that I want info on James, but don't know that he is 21, green, and loves pizza. So I type in james in the search bar.

    All of the data (james, 21 yo, green, pizza) should pop up in a new tab. Then, the search should automatically look for all other people who are either 21, OR green, OR love pizza, because I want to introduce James to them.

    Add'l Notes:
    - Sometimes there may be 5 james who are 21, green, but love a different food.
    - Case (upper vs lower) can't matter in the search (james should work as well as James).

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Multi-Search Code

    Actually, this sounds like a perfect case to use a relational data base such as Access to derive the information. If you don't have Access available, then you may want to try using MS Query which is part of every Excel program. This would be a simple select query in either program.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    11-05-2014
    Location
    SF
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Multi-Search Code

    1. Are you sure this would give me all the links I need? I'm worried if I put James in as the name, only fields with James would populate. I actually need all the fields that are the same as james info (21, green, pizza) as well.
    2. Would an average corporate worker be able to run a search via MS Query with limited instructions?
    3. Do I need to download MS Query, or is it already in Excel 2010?

    Thanks!

  4. #4
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Multi-Search Code

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Multi-Search Code

    1. you would not list James as one of the criteria. You would search for all names and set the criteria for each of the other fields.
    2. Possibly. It may be easier to format with a search form in Access if you are going to let multiple people who are not Access savvy do it. One possibility is that you only need one copy of Access to build the database and then use Access Runtime (free with 2010) on all other machines. See link below
    3. MS query is already loaded as part of Excel 2010. See the second link below.

    Link for explanation of Runtime: http://www.hitechcoach.com/

    Link for explanation of MS Query: http://exceluser.com/formulas/msquer...ional-data.htm

  6. #6
    Registered User
    Join Date
    11-05-2014
    Location
    SF
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Multi-Search Code

    @alansidman, The problem is that the users won't know that James is 21, green, and likes pizza. They just know that they want a James, and anybody else who is like him.

    I've attached an example (with my failed code embedded). The highlights on the second tab are what should be matched via the search criteria.VBA Template.xlsm

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Multi-Search Code

    My apologies, but I don't know how to tell either excel or access how to search for records without knowing the specific criteria. I'm thinking you may have to rethink your approach to this issue. However, there are brighter people in this forum who may have other suggestions. This one is just out of my wheelhouse.

  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: Multi-Search Code

    Your initial search.... will it always be by name? Or other columns? And if other columns, you are always looking for the first result matching that search to key off the other 3 searches?
    _________________
    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!)

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,322

    Re: Multi-Search Code

    Sounds like a two stage task. Input a name, get his information then use that to search for like minded people. Would it be a 100% match or a partial match?
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  10. #10
    Registered User
    Join Date
    11-05-2014
    Location
    SF
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Multi-Search Code

    Your initial search.... will it always be by name? Or other columns? And if other columns, you are always looking for the first result matching that search to key off the other 3 searches? - It can be by any of four columns, but if necessary, can make it by 1 name/ID. I would indeed always want the first search to kick off the other matches.

    Sounds like a two stage task. Input a name, get his information then use that to search for like minded people. Would it be a 100% match or a partial match? - It would be a partial match. If someone likes pizza, but is different age and color, we still want to know about them.

  11. #11
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Multi-Search Code

    Here's a basic version you can modify
    Put your name into J1 and press the run button and it will return all matches
    advanced filter.xlsm
    Happy with my advice? Click on the * reputation button below

+ 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. [SOLVED] Working code need to be expanded to multi search also.
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-12-2014, 12:08 AM
  2. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  3. Multi conditional search
    By sanyaa in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-03-2014, 05:10 PM
  4. [SOLVED] Match search terms, and add data in next column. Multi search problem.
    By Wales MB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-23-2013, 06:10 PM
  5. VBA sum on multi search criteria - how?
    By adventurous in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2005, 07:46 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