+ Reply to Thread
Results 1 to 8 of 8

Allow Search to perform partial word searches

  1. #1
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Allow Search to perform partial word searches

    Greetings Everyone,

    I have a database with a userform search interface. Is there a way to convert this current code, and adapt it to where it will perform partial word searches? As it stands now, if you try to search for, lets say, the second word of a movie title, it will not bring up that movie in the search results.

    Thanks in advance for any advice you can give me.

    dr

    I have attached a sample for your review...
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Allow Search to perform partial word searches

    I'm assuming you are referring sub routine Private Sub cmdSearch_Click()

    try this instead of
    Please Login or Register  to view this content.
    change to

    Please Login or Register  to view this content.
    this just adds * wildcards to your adv filter search
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Allow Search to perform partial word searches

    But that would mess up your Year or Runtime search.
    I was thinking something more like

    Please Login or Register  to view this content.
    Last edited by bakerman2; 12-12-2017 at 09:52 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Allow Search to perform partial word searches

    Very true, however, I primarily need it to search for movie titles. I will no doubt use this for other purposes and it is good to know about Bakerman2 fix for future problems that might crop up. Thanks to humdinaling and bakerman2 for all the help and suggestions!!

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Allow Search to perform partial word searches

    I've edited the code of my previous post so you can now use it for Year, Runtime, Partial Title, Partial genre, Partial MPAA

    Thanks for rep+.

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Allow Search to perform partial word searches

    Good pick up baker had my blinkers on

    this side on second look

    ID is greyed out but if that is meant to be searchable too then you need to add it to list of options

    Runtime is a bit weird how its works
    IMO - going to be very hard to search anything in this field
    better off using range or implying at least time frame
    ie at least 50 minutes so auto insert a ">" symbol

    but then you issues with format as some have with 1h 20 ...some of 58 min or 129
    just not really consistent

  7. #7
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Allow Search to perform partial word searches

    The ID field is just a marker. basically a row marker.... It has no use really. I really enjoyed both of your solutions and suggestions. thanks!

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Allow Search to perform partial word searches

    Cheers thanks for the rep

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. use file to perform searches
    By drflgd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-23-2017, 07:17 PM
  2. Replies: 15
    Last Post: 07-27-2017, 08:18 AM
  3. Replies: 3
    Last Post: 01-22-2015, 06:21 PM
  4. How to perform multiple searches across rows and columns in one statement
    By greyscale in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2013, 10:20 PM
  5. vlookup to search for partial word?
    By lnjr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-18-2008, 02:42 PM
  6. [SOLVED] how to use partial (word) search
    By Vikky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2006, 08:15 AM
  7. how to use partial (word) search
    By Vikky in forum Excel General
    Replies: 3
    Last Post: 07-14-2006, 08:05 AM

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