VBA - User Form: Search as you Type using TextBox and ListBox | Search by criteria

Поділитися
Вставка

КОМЕНТАРІ •

  • @malcolmt3125
    @malcolmt3125 6 місяців тому +2

    This is absolutely awesome, there are very few that implement a userform for this type of search, that you can actually follow along and can tweak to get it into your own project. Thank you for you time in putting this out for the masses. Not sure why you didn't post the actual code as well, but that made for a better understanding

  • @Jojosmith342
    @Jojosmith342 Рік тому +1

    Excellent. You're great VBA teacher. Thanks for your best code and another useful tutorial. Your code works like miracle. All thumbs up. Already subscribed

  • @xoxo6911
    @xoxo6911 4 місяці тому +3

    How do you display more than 10 columns in the list box? Only able to show 9

  • @Belive_in_Jezus_Christ
    @Belive_in_Jezus_Christ 4 місяці тому +3

    You didn't show how the header of each of the 9 columns is placed at the end of the video, we were left with the form without the header of the columns?

  • @binodrabha6633
    @binodrabha6633 Рік тому +1

    sir 10 above loop posible or not ?

  • @abhilashsnamboothiri8134
    @abhilashsnamboothiri8134 Рік тому +3

    sir, it shows an error - variable a is not defined. How can I solve this

    • @shana0165
      @shana0165 Рік тому

      same

    • @edthbkk1
      @edthbkk1 9 місяців тому

      Add "Dim a" to the top of the form, first line

  • @VuongBui-b2k
    @VuongBui-b2k 4 місяці тому

    Is the Excel file used in the demonstration available for download? I did not see the link.

  • @cyberbeast1789
    @cyberbeast1789 2 місяці тому

    with this code is it possible than when you double click the listbox data will display on texboxes?

  • @adeshraka6668
    @adeshraka6668 Рік тому +3

    How to search listbox name midlename last name.. Example.. In textbox type..A B C.. result..Adi Bike Care in vba please vba code..

  • @mohamedrushan7705
    @mohamedrushan7705 Рік тому +3

    How to get the header on list box. . Isn't explained but finally on there how????

    • @ronedwardyap6940
      @ronedwardyap6940 10 місяців тому +1

      Same

    • @c0deblack
      @c0deblack 5 місяців тому

      same, i used “listbox1.clear” and this make listbox has no headers 😢

    • @angelou8633
      @angelou8633 4 місяці тому

      yeah, i use rowsource

    • @RAHIMPHYSICS
      @RAHIMPHYSICS 3 місяці тому

      @@angelou8633 How did you used that? I am trying but facing problem, can you please help?

    • @angelou8633
      @angelou8633 3 місяці тому

      @@RAHIMPHYSICS ua-cam.com/video/TuInj-DJ80A/v-deo.html

  • @jdresurreccion3304
    @jdresurreccion3304 8 місяців тому

    loved this! I'll test this on the project I am currently working on. Is it possible to conduct the search anywhere in the criteria?
    For example, if I type or, it will show the result of any word that has letters "or" and not just the one that starts with or?

  • @anon-design
    @anon-design 4 місяці тому

    how i want add column detals like you with color green please see in last scene 12:55

  • @ahmadabunaqoos1602
    @ahmadabunaqoos1602 7 місяців тому +1

    this only work for 9 column ia any way to use more than 10 columns

  • @PopoyTanke
    @PopoyTanke 6 місяців тому

    Hi, I'm getting the error variable not defined on a = Len(Me.TxtSearch.Text) where can I set the A variable?

  • @shilpag8172
    @shilpag8172 3 місяці тому

    Hello, can we have something similar when the user form is connected to a MS Access with a set of data..is there any video on this?

  • @portregaleri
    @portregaleri 8 місяців тому

    I tried to correct the codes for the listview. But I couldn't. Can you edit the codes for the listview? Thank you.

  • @roronoazoro8343
    @roronoazoro8343 Рік тому +2

    good but could have been better and faster to work with the large table by using filtering the table using Wildcard(*) and coping the data to a temp sheet and then bringing the data in the list box with range. by converting the data in to the table it gives whole lot of functions to use for us and still keeping all the sheet functions also.

  • @onlineservices6150
    @onlineservices6150 Рік тому +2

    Sir I need help 🙏
    Why this search method is working slow when data is more than 100 and searh textbox responding very slow. Please give the solution .

    • @angelou8633
      @angelou8633 5 місяців тому

      yeah , it loads very slow. did you find a solution?

  • @anhnhatnguyet4628
    @anhnhatnguyet4628 Рік тому

    vba excel, A1 type a few characters (if it supports Vietnamese, even better), B1 is the directory path to search, when found in B1 the word or excel file contains the same content as A1, then will return results from C1 down: the search path to the folder containing the word or excel file, the result contains content identical to A1 (including the file name). please help me

  • @MultiBoleba
    @MultiBoleba 8 місяців тому

    My code don't work, the informations are not showed in listbox after all, anyone have a tip for the solution?

  • @ahmetkilicarslan6178
    @ahmetkilicarslan6178 Місяць тому

    How can I see more than 9 columns?

  • @simplydoing9596
    @simplydoing9596 2 місяці тому

    the a= Len ... line is giving ERROR
    i don't know but error13
    why? how to correct

  • @javedakhtarjp
    @javedakhtarjp Рік тому

    sir , how to search text in the middle?

  • @dilipbera1970
    @dilipbera1970 Рік тому +1

    it shows only first column, please help

    • @medising3802
      @medising3802 Рік тому +1

      Go to the properties of your ListBox, and increase the ColumnCount to the number of Columns you want to see. Maybe this helps.

  • @tejsinghsarangdevot8198
    @tejsinghsarangdevot8198 2 місяці тому

    First row header is not fix how to solve

  • @melakutilahun3316
    @melakutilahun3316 8 днів тому +1

    no display on listbox

    • @hay_kel
      @hay_kel  8 днів тому +1

      first thanks for your comment. i think you need to initialize the event. it's explained from 4:24 to 5:34

  • @alim6770
    @alim6770 10 місяців тому

    can u send me the file

  • @abdullahshafiq5924
    @abdullahshafiq5924 25 днів тому +2

    Use "search for" 🙄

  • @games-by2fy
    @games-by2fy Рік тому +1

    thank you so much

  • @melakutilahun3316
    @melakutilahun3316 9 днів тому +1

    thank you very much for clear presentation
    i write the code but nothing display on listbox2
    my column is 4
    =======
    Dim criterion
    Private Sub ComboBox1_Change()
    Dim c As Integer
    Dim column_headers
    column_headers = Array("A", "B", "C", "D")
    For c = 1 To 4
    If Sheet2.Cells(1, c).Value = Me.ComboBox1.Value Then
    criterion = column_headers(c - 1)
    End If
    Next
    Sheet2.Cells(1, "K").Value = criterion
    Me.ListBox2.Clear
    Me.TextBox1.Value = ""
    Me.TextBox1.SetFocus
    End Sub
    Private Sub TextBox1_Change()
    On Error Resume Next
    If Me.TextBox1.Text = "" Then
    Me.ListBox2.Clear
    Exit Sub
    End If
    Me.ListBox2.Clear
    Dim r, last_row As Integer
    last_row = Sheet2.Range(cell1).End(xlUp).Row
    For r = 2 To last_row
    a = Len(Me.TextBox1.Text)
    If UCase(Left(Sheet2.Cells(r, criterion).Value, a)) = UCase(Me.TextBox1.Text) Then
    With Me.ListBox2

    .AddItem Sheet2.Cells(r, "A").Value
    .List(.ListCount - 1, 1) = Sheet2.Cells(r, "B").Value
    .List(.ListCount - 1, 2) = Sheet2.Cells(r, "C").Value
    .List(.ListCount - 1, 3) = Sheet2.Cells(r, "D").Value
    End With
    End If
    Next

    End Sub
    Private Sub UserForm_Initialize()
    Dim c As Integer
    For c = 1 To 4
    Me.ComboBox1.AddItem Sheet2.Cells(1, c).Value
    Next
    With Me.ListBox2
    .ColumnCount = 4
    .ColumnWidths = "80;80;80;80"
    End With
    End Sub
    =====

  • @erol9000
    @erol9000 Рік тому +1

    Super

  • @shahabali4518
    @shahabali4518 7 місяців тому

    Excellent

    • @hay_kel
      @hay_kel  5 місяців тому

      Thank you! Cheers!

  • @adonisfilea2529
    @adonisfilea2529 11 місяців тому

    Thank you very much

    • @hay_kel
      @hay_kel  11 місяців тому

      You are welcome

  • @suleymanturkmen2748
    @suleymanturkmen2748 11 місяців тому

    harika

    • @hay_kel
      @hay_kel  11 місяців тому

      Thank you

  • @manojsingal1136
    @manojsingal1136 8 місяців тому

    Na ismeaapne search की कोई coding ki hai kuch kaam nhii kar raha pagal बना रहे हो ना Sheet downloads की try के liye

  • @GopalBiswas-wt5ef
    @GopalBiswas-wt5ef Рік тому

    Sir
    31 March 2024 file expired हो जाएगा 1st अप्रैल open ओपन करने के लिए पासवर्ड देना होगा Excel VBA code कैसे लिखो लिखें