Closed Thread
Results 1 to 16 of 16

Create 'search engine' function Excel database.

  1. #1
    Registered User
    Join Date
    08-08-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Create 'search engine' function Excel database.

    Hi all,

    I am looking to create a search engine capability inside a database I have created in Excel. I realise there is the find function already built into Excel however this is not what I want.
    Ideally I want a text field at the top of the worksheet that returns every row from a large database that contains a match with specified text either stand alone or contained within a string. ie searching for 'xyz' returns the results of 'xyz' and '123xyz456'.
    The rest of the database entries are removed from the search results, not just highlighting the found text. This is because the database is very large and to scroll through all of the entries looking for results would not be user friendly.
    I also want to only search database entries, meaning the column headings ect stay visible with the search results displayed in the relevant column.

    As a bit of background the database contains a list of ~1000 products with their characteristics populating each row as you go along the column. The search would then be able to return product X Manufactured by Y if the user searched for Y.

    While I have some experience with coding, C++ and Java but not VisualBasic, this is not a coding project so I would appreciate as much help as possible when it comes to the code.
    I am fairly new to advanced level Excel.

    The second part (I think will be slightly easier) is to have a 'sort by' drop down box, something likeyou have on Amazon ect, whereby the user can select sort by make, model, price ect and it returns the list aalphabetically according to this field.

    Thanks in advance!!!

    Toby

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Create 'search engine' function Excel database.

    @tbrown3

    Here's a link to something I done simuliar to what you wanting. Look at post 12 it has a workbook attatched.
    http://www.excelforum.com/excel-prog...rd-phrase.html
    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-08-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Create 'search engine' function Excel database.

    Hi Mike,

    Thanks for the quick response.

    Yes, this is pretty much exactly what I'm after. Your workbook won't let me run the macro, giving me the error:

    Cannot run the macro "Search%20Data(1).xlsm'!SearchParts'. The macro may not be available in this workbook or all macros may be disabled.

    Macros are enabled so it's not that.

    Cheers Toby

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Create 'search engine' function Excel database.

    Did you download the workbook to your computer? Try right clicking on the button and select Assign Macro. then select Search Parts.

  5. #5
    Registered User
    Join Date
    08-08-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Re: Create 'search engine' function Excel database.

    macro not working.png

    I downloaded the file.

    It does not give me the option search parts. It gives me the attached print screen window.

    Thanks

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Create 'search engine' function Excel database.

    How did you save the workbook .xlsx or xlsm? Workbook must be saved as xlsm. Anyway Ill attach it here.

    Search Data.xlsm

  7. #7
    Registered User
    Join Date
    08-08-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Create 'search engine' function Excel database.

    I definitely saved it as an slsm 'Microsoft Excel Macro-Enabled Worksheet'. Just tried again and I get the same result

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Create 'search engine' function Excel database.

    Hum I dont know. Well if you have the workbook, here's the code to place in it. Put into a standard Module and not sheet module.

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-08-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Re: Create 'search engine' function Excel database.

    Hi Mike,

    Thanks for the code. I tried to implement it but I couldn't get it to work. I've uploaded the original file (with most of the data removed) so if you have time you could help with this one.

    Cheers

    Toby

    ATTACH]173343[/ATTACH]
    Attached Files Attached Files

  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Create 'search engine' function Excel database.

    Toby,

    Not sure by looking at you workbook and reading your first post what is to be done. What columns are we looking for the search key word? Where are the results to be placed?

  11. #11
    Registered User
    Join Date
    08-08-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Re: Create 'search engine' function Excel database.

    Database Framework.xlsx
    Sorry, I realise I'm not explaining it very well. I've edited the file to try and make it clearer.

    Could the search results be displayed on the second sheet marked 'search'?
    Likewise for the 'sort by' function (i don't even know if this is possible??). Ideally I would like it to display a version of the data base on that sheet that contains all the entries but sorted by the selected parameter.

    Hope this help clear things up.

    Cheers

    Toby

  12. #12
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Create 'search engine' function Excel database.

    Toby,

    Im still a little confused? Can you give me and example of a search? Im guessing Row 13 downward is where you want to search, but what column is the search to be done on?

  13. #13
    Registered User
    Join Date
    04-18-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Create 'search engine' function Excel database.

    Hi Mike,

    You are really a Genius!!

    Well I was trying something on search & display data and I came across to your code (Search data.xlsm) which is useful to me.

    But Mike can this be in case sensitive mode? My search mode is based on Abbreviations I have a list of abbreviations and their details to fetch.

    From your above code I can fetch data but only I am lacking in a case sensitive method. I would really appreciate if you can let me know codes for case sensitive.

    If so then I can easily search Character wise in my database.

    For Example:
    A, A-, a., a-, BB, bb like that abbreviations

    Waiting for response!

    Thanks,
    Kenny

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Create 'search engine' function Excel database.

    kennylal,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  15. #15
    Registered User
    Join Date
    04-18-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Create 'search engine' function Excel database.

    Ok, I am really sorry for that as I was not aware of the rules.

  16. #16
    Registered User
    Join Date
    04-12-2013
    Location
    davao city philippines
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Create 'search engine' function Excel database.

    hi mike.. i'm reina ....i find your code for "Search Data.xlsm" at http://www.excelforum.com/excel-prog...-database.html very helpful to make my inventory work very easy... but my product details has "12 columns", can you help me make it, that i can search on "data" sheet from either "A" or "B" and all the details from Coloum A to L appears on the "search" sheet / list. pls help....thank you so much.

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 04-23-2013 at 12:07 AM.

Closed 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