• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Filter Listbox using textbox

Fred Wayne

Member
Hello. My name is Fred. I am making a little project for my University. I am making a file in which I have several sheets. One of those sheets is called "Guests", I need to make an UserForm with a ListBox in which all guests names will be displayed(Guests names are in "Guests" Sheet.) I have created a TextBox and I need to search guest names from that textbox. All the Sheets have a button to display the "Guests UserForm", but when I try to open it, an error of "Run-Time error '9': Subscript Out of range" is displayed. A made a macro to search from the same guests sheets but it makes my workbook kind of slow. Would you please help me with this. I have tried on different ways to make it filter from "Guests" sheet but it has been so hard for me to get it. I would love you to help me on this. In the "Guests" UserForm you will find the code I used to make the textbox filtering. I will attach some screenshots and the original file. On a past forum I requested for your help, and you did help me and you fixed a file I sent. but I had to open a new post. I´d really love you to help me finding out why i can´t get it. YOU ARE THE BEST. THANK YOU VERY MUCH.
 

Attachments

  • WorkBook.PNG
    WorkBook.PNG
    162 KB · Views: 10
  • Button for opening the UserForm Guests.PNG
    Button for opening the UserForm Guests.PNG
    242.4 KB · Views: 9
  • Guests Sheet, here you can find all the guests names that must appear on the UserForm ListBox..PNG
    Guests Sheet, here you can find all the guests names that must appear on the UserForm ListBox..PNG
    161.4 KB · Views: 11
  • I Need The TextBox Filters the Guests Names with info from the ListBox.PNG
    I Need The TextBox Filters the Guests Names with info from the ListBox.PNG
    102.8 KB · Views: 14
  • Code I used for the UserForm to filter from TextBox.PNG
    Code I used for the UserForm to filter from TextBox.PNG
    122.5 KB · Views: 13
Pictures
Hi and welcome to the forum

Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.
 
This is the original File of my project. I forgot to send it with the other files I sent before
 

Attachments

  • LogBook June Freddy Wayne - Copy.xlsm
    779.6 KB · Views: 26
The file I have just sent, it´s a file that I make some days ago and you helped me to get the code to filter information in the ListBox from the TextBox
 

Attachments

  • Guests.xlsm
    83.4 KB · Views: 33
Hi Fred,
This is an easy one:)
In your code you have
Code:
With Sheets("Guests").ListObjects(1)
ListObjects(1) means a table but in your example you don't have a table.
Solution: insert a table in the guests sheet.
See attached.
 

Attachments

  • LogBook June Freddy Wayne.xlsm
    744.9 KB · Views: 91
Wow amazing. I don´t have words to express how ashamed. I never imagined it was that simple issue. Thank you so much. I was so tired that I never realized about the table. You are the best.
 
Back
Top