none
Data verification-lists RRS feed

  • Question

  • Once I've created a list box by selecting Data Verification and using my list, I need to quickly get a certain name in the list, by using the first letter. For example: If I had a list with a lot of Product names, I would like to write letter S to get all the products starting with S (for the name "Social media Online course" and so on). The list is long. I think that this have worked, earlier.

    Why does this not work anymore?

    Can I do anything else?
    Is there any step-by-step explanation I can use to programme these?

    Thanks in advance,

    Monica

    Monday, January 8, 2018 11:33 AM

All replies

  • Do you mean Data Validation? Unfortunately, it doesn't support autocomplete, and never has. See http://www.contextures.com/xlDataVal10.html for an alternative. This article contains written instructions, a tutorial video and a downloadable sample workbook.

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Monday, January 8, 2018 12:43 PM
  • Hi Monicaive,

    you had mentioned that,"I need to quickly get a certain name in the list, by using the first letter. For example: If I had a list with a lot of Product names, I would like to write letter S to get all the products starting with S (for the name "Social media Online course" and so on)."

    you can refer example below.

    Private Sub TextBox1_Change()
    ScrubSheets
    End Sub
    
    Sub ScrubSheets()
     Me.ListBox1.Clear
    Dim lastRow As Long
    Dim myRow As Long
    
    Application.ScreenUpdating = False
    
    lastRow = Cells(Rows.Count, "A").End(xlUp).Row
    
    For myRow = 2 To lastRow
    
       
        If Cells(myRow, "A").Value Like Me.TextBox1.Text & "*" Then
                Me.ListBox1.AddItem (Cells(myRow, "A").Value)
               
            End If
    
    Next myRow
    
    Application.ScreenUpdating = True
    
    End Sub
    

    Output:

    this is just a sample example. you can modify the code based on your requirement.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 9, 2018 2:59 AM
    Moderator
  • Hi Monicaive,

    Is your issue resolved?

    I find that, After creating this thread, You did not done any follow up on this thread.

    If your issue is solved then I suggest you to share your solution and mark it as an answer.

    If your issue is still persist then I suggest you to refer the suggestions given by the community members may help you to solve your issue.

    If then after you have any further questions then you can let us know about it.

    We will try to provide further suggestions to solve it.

    I suggest you to update the status of this thread. This thread is still open and will remain open until you mark the answer.

    So take appropriate steps to close this thread , If your issue is resolved.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 18, 2018 9:28 AM
    Moderator
  • Thank you // Monica

    Friday, January 19, 2018 1:38 PM
  • Thanks // Monica

    Friday, January 19, 2018 1:38 PM