+ Reply to Thread
Results 1 to 20 of 20

Userform - Multiple Search instantly

  1. #1
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Userform - Multiple Search instantly

    I have data on sheet named DATA. I have columns with the following names:

    column A: no.
    column B: Name
    column C: id
    column D: ***
    column E: age
    column F: date of birth
    column G: IQ Test
    column H: Meaning of Name

    I designed a crude UserForm that includes some of the above.

    My goal is to write a code that, by writing each of the fields, instantly searches on corresponding column in DATA sheet and show results in ListBox.

    I know that a way is write code so that when change in any of the fields, the rows stored in the listbox and results limited to the new search value.

    In this way, the list box is instantly limited by field changes. But I don't have the possibility to write its code.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,150

    Re: Userform - Multiple Search instantly

    If you are entering number - unique to each row - then there is no requirement to manually enter the other fields as a match on number will obtain the other fields. Simply put the field data in text boxes.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    Quote Originally Posted by JohnTopley View Post
    If you are entering number - unique to each row - then there is no requirement to manually enter the other fields as a match on number will obtain the other fields. Simply put the field data in text boxes.
    Suppose the user entered the character a in the textbox Name. Only rows should appear in the list box with the character a in their name and the rest should not appear.

    Then the user added n, at the same time to remove from the previous results the names that do not contain an.

    Then, the user insert character 2 in age field, it must be remove all previous results that not contain 2 in age.

    Important thing is all the above must do instantly. I mean these things happen without putting the search button and hitting it.
    Last edited by niksirat2030; 09-07-2022 at 07:58 AM.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Userform - Multiple Search instantly

    This will give you an idea...Start typing in NAME or ID

    Edit...
    Only rows should appear in the list box with the character a in their name and the rest should not appear.
    If above is what you want... then one small change...add red snippet

    Please Login or Register  to view this content.
    Also...play around with other settings...
    Attached Files Attached Files
    Last edited by sintek; 09-07-2022 at 08:15 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,150

    Re: Userform - Multiple Search instantly

    with the character a in their name
    I hope you don't mean this literallY but the name starts with "a" or whatever the character(s) is(are).

    If you mean "a" ANYWHERE in the name (or "2" anwhere in an age -25, 32, 72) ..... Good luck !

  6. #6
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    Quote Originally Posted by JohnTopley View Post
    I hope you don't mean this literallY but the name starts with "a" or whatever the character(s) is(are).

    If you mean "a" ANYWHERE in the name (or "2" anwhere in an age -25, 32, 72) ..... Good luck !
    I mean "a" ANYWHERE. If added a char to it , like m, "am" should be in the name "anywhere" not start with it, and for all field like this.

  7. #7
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    Quote Originally Posted by sintek View Post
    This will give you an idea...Start typing in NAME or ID

    Edit...

    If above is what you want... then one small change...add red snippet

    Please Login or Register  to view this content.
    Also...play around with other settings...
    I test it. "dr" nothing show Badra be in the list, and , when type anything in name field, so type a number to id , and delete that num in id, all field show in the listbox.

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Userform - Multiple Search instantly

    Is this not what you wanted...

    Untitled.png

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,150

    Re: Userform - Multiple Search instantly

    Try attached with Sintek "tweak"
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    Quote Originally Posted by JohnTopley View Post
    Try attached with Sintek "tweak"
    Type, "dr" in name field, then type "ma" in *** field, results not true.

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Userform - Multiple Search instantly

    My goal is to write a code that, by writing each of the fields, instantly searches on corresponding column in DATA sheet and show results in ListBox.
    You...Are not being transparent with your requirement...
    results not true
    I suggest you upload a sample file showing exactly the result you expect when typing in specific letters...We...Are not mind readers...
    You have also not responded to post 8?

    Edit...Are you wanting to search Name, then search ID then search *** etc etc and make use of all these inputs to narrow down the search as you "type as you go"?
    Last edited by sintek; 09-08-2022 at 03:18 AM.

  12. #12
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    You...Are not being transparent with your requirement...
    I explain:
    Quote Originally Posted by niksirat2030 View Post
    My goal is to write a code that, by writing each of the fields, instantly searches on corresponding column in DATA sheet and show results in ListBox.
    Also in title of question "Multiple Search instantly" I clear what i want.

    Suppose there is a list with a lot of data in front of you.

    First, in one of the fields, for example, in the "name", you enter a name or a part of it. The list is limited according to the given value.

    Now you fill another field (in no order, completely arbitrary) for example "age".

    What do you expect? It is only reasonable to expect that the previously limited list (by completely or partially filling a previously desired field) will be limited again according to the new value, bringing you closer to what you want and limiting the number of results.

    And, when you delete part of any fields that you fill it, the list of results will be updated according to the remaining values.

    All the difficulty of this issue is to do all the above things instantly.

    Without this condition, it is easy to put a search button that by pressing it will apply any number of restrictions in the data list.

    But when the search is instantaneous, against any change in any field, the last value in the ListBox must be updated.

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Userform - Multiple Search instantly

    Something like this...Perhaps
    Attached Files Attached Files
    Last edited by sintek; 09-08-2022 at 04:15 AM.

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Userform - Multiple Search instantly

    Look at this...4 year old post...No need to re-invent the wheel...Here jindon has perfected this requirement...
    Attached Files Attached Files

  15. #15
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Userform - Multiple Search instantly

    Hello
    With the following variant, you can filter on all fields without losing column headers:
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,206

    Re: Userform - Multiple Search instantly

    So here's one more way. By using Recordset.

    Artik
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    Quote Originally Posted by sintek View Post
    Something like this...Perhaps
    Great, thanks sintek for your answer, but not work for "***" field.

  18. #18
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    Quote Originally Posted by sintek View Post
    Look at this...4 year old post...No need to re-invent the wheel...Here jindon has perfected this requirement...
    When you delete some char in any fields, list do not update.

  19. #19
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    Quote Originally Posted by beyond Excel View Post
    Hello
    With the following variant, you can filter on all fields without losing column headers:
    Thank you very much for your answer. It works perfectly.

  20. #20
    Registered User
    Join Date
    11-16-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    51

    Re: Userform - Multiple Search instantly

    Quote Originally Posted by Artik View Post
    So here's one more way. By using Recordset.

    Artik
    Great, it works perfectly.

+ 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. Userform Search when search two text boxes return multiple results
    By nekiwa07 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2020, 09:42 AM
  2. the value of userform object not change instantly
    By ardhean in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2015, 10:35 PM
  3. Show instantly calculated value from textboxes in UserForm
    By smjjvh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-06-2014, 03:10 PM
  4. Create a search userform to search using multiple criteria
    By Aleemaher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2014, 09:17 AM
  5. [SOLVED] Search for multiple rows from multiple sheets by criteria & show result in userform
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2014, 11:29 AM
  6. How To Mass Download Multiple Files In One Go instantly?
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2013, 02:08 AM
  7. TextBox in UserForm to show cell value instantly
    By gsandy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-03-2009, 09:32 PM

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