Consulting

Results 1 to 3 of 3

Thread: Search Textbox

  1. #1
    VBAX Newbie
    Joined
    Apr 2020
    Posts
    4
    Location

    Search Textbox

    hi, how can i change this code to ignore uppercase and lowercase characters?

    Thanks


    PHP Code:
    Dim rng As RangeDim c As Range
    Dim a 
    As String 'listbox ricerca parziale

        ListBox1.Clear
        With Sheets("Database")
            Set rng = .Range(.Cells(5, 920), .Cells(.Cells(65536, 920).End(xlUp).Row, 920))
                    
            a = "*" & Ricerca_txt & "*" '
    listbox ricerca parziale
            
            
    For Each c In rng
                
    If c.Value Like a Then 'listbox ricerca parziale
                    With Me.ListBox1
                        .AddItem
                        .List(.ListCount - 1, 0) = c.Value
                        .List(.ListCount - 1, 1) = c.Offset(0, 1).Value
                        .List(.ListCount - 1, 2) = c.Offset(0, 2).Value
                    End With
                End If
            Next
        End With '
    listbox ricerca parziale     Set rng Nothing 'listbox ricerca parziale 

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    try changing:
    a = "*" & Ricerca_txt & "*" 'listbox ricerca parziale
    to:
    a = "*" & LCase(Ricerca_txt) & "*" 'listbox ricerca parziale

    and:
    If c.Value Like a Then 'listbox ricerca parziale
    to:
    If LCase(c.Value) Like a Then 'listbox ricerca parziale
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Newbie
    Joined
    Apr 2020
    Posts
    4
    Location
    Quote Originally Posted by p45cal View Post
    try changing:
    a = "*" & Ricerca_txt & "*" 'listbox ricerca parziale
    to:
    a = "*" & LCase(Ricerca_txt) & "*" 'listbox ricerca parziale

    and:
    If c.Value Like a Then 'listbox ricerca parziale
    to:
    If LCase(c.Value) Like a Then 'listbox ricerca parziale

    It works!!
    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •