+ Reply to Thread
Results 1 to 9 of 9

Textbox ActiveX control as a search bar

  1. #1
    Registered User
    Join Date
    06-23-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    70

    Textbox ActiveX control as a search bar

    search box.xlsx

    Please find the attached. I want to have a search function using the textbox from ActiveX control. I know there is already a built in search function on the first rows which is the autofilter
    For example if i need to search for Equipment Name starting with "FLD" I need to:
    1. Search on the correct column to search
    2. Click the arrow on cell b2
    3. Click the textbox for autofilter
    4. Type the "FLD"
    5. Press enter.
    6. Rows 3 to 17 will show up

    But there are times that it would take me time to think what column i need to go to search for one a row. For example, I need to know which equipment are owned and which are cross-hired. The thing i need to do is go to cell M2 and do that 5 steps again but sometimes i forgot which columns i need to perform the search, and my real record has a total of 27 columns and 400+ rows. And it consume considerable amount time to go back and forth thru the whole sheet. I frequently use this system to search and retrieve neede information.

    So my requirement is like this, using the textbox located in front of Cell C1, i just want to type something Im looking for and it will show the result. And this is without pressing enter for it to be much faster. Hence the step will be like this:

    1. Click on textbox
    2. Type "FLD"
    3. Rows 3 to 17 will show up.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Textbox ActiveX control as a search bar

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-23-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Textbox ActiveX control as a search bar

    Thanks for the immediate response Andy. That's what exactly the function i'm looking however if you can expand selection and include all columns. The searchbox works only in Column B, but i want it to work on all columns only using the same one text box. Some examples:

    1. If i typed "Jubail", it should show rows 5,4, and 29.
    2. If i typed "EIS", rows 23 and 25 will show.
    3. If i typed "X", rows 21 will show.

    Also the search should not be limited only on the first characters. It should be in the middle of the last. Examples:

    1. If i typed "ubai", it should show rows 5,4, and 29.
    2. If i typed "IS-P", rows 23 and 25 will show.
    3. If i typed "-MA", rows 21 will show.
    Last edited by miss_chloe; 12-16-2013 at 05:15 AM. Reason: Revising the comment

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Textbox ActiveX control as a search bar

    Please Login or Register  to view this content.
    Notice the table reference has changed. You have 3 tables on that sheet with overlapping ranges.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-23-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Textbox ActiveX control as a search bar

    Thank you this was a great improvement compare to the first one, however i just notice that it's not searching Column A, E, F and G. I am just assuming that the code needs improvement to recognize cells formatted into date and integers. Or i might be doing something wrong. looking forward on your response.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Textbox ActiveX control as a search bar

    If you remove the overlapping tables and use a single table that encompasses all of the fields it will work.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-23-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Textbox ActiveX control as a search bar

    First, thanks again for fixing it. But the Column D is still not working. I tried to fix it myself based on your comment but I don't fully understand what you mean by overlapping tables. But i understand what you meant about "single table", it makes sense in a way that the code should read only one table not multiple so there will be no conflicts. Therefore what i did is i change the whole sheet into a normal range and formatted into table again just to make sure, that means the whole datasheet is formatted as a single table. Still the Column is not being recognized by the search bar and that is the cells formatted in Date. I hope this can be fix, that's the only thing missing in my requirement.

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Textbox ActiveX control as a search bar

    Your original file had 3 tables defined.
    Table13 $B$3:$G$29
    Table3 $A$3:$A$29
    Table4 $H$3:$M$29

    Non of which completely covered all the data.

    In the latest file I removed those tables and defined just on.
    Table1 $A$3:$M$29

    The date entry works for me. If I type in 15/o then row 29 only is displayed. You have to enter what is displayed in order to match records. 15/10 would not match with 15/Oct

  9. #9
    Registered User
    Join Date
    06-23-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Textbox ActiveX control as a search bar

    it works. thank you very much. i think its just a matter of how to properly type the date.

+ 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. SEARCH ENGINE using combo box and and activex control
    By Ryan_Bernal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-24-2012, 01:38 AM
  2. Form Control or ActiveX control?
    By mcctrader in forum Excel General
    Replies: 0
    Last Post: 08-22-2012, 10:52 AM
  3. Replies: 3
    Last Post: 02-07-2012, 11:31 AM
  4. Control Forms or ActiveX Control
    By ASPERO in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2011, 04:57 PM
  5. How to control "Date Time Picker ActiveX Control"
    By Jafery in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2005, 10: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