Results 1 to 6 of 6

optimalize search with textbox

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-18-2008
    Location
    Slovakia
    MS-Off Ver
    Office 2016
    Posts
    162

    optimalize search with textbox

    Hi,
    pls. how can i optimalize thic code, that it works faster, better?
    and how to change it that it will return only unuique value to column C?

    is here possibility how to make faster to search in huge table?
    i want to use it for search in big table...i have defined ranges in 2 sheets, but it take a long time ..
    what can i do, that will works faster?

    e.g. i have this code (but i will define more as one sheet)
    and it take a long time to searching only in a few cells..what will do with 7000 row ?


    Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode = 13 Then
    Dim i As Long, j As String
    Range("C:C").ClearContents
    j = UCase(TextBox1.Value)
    
     If TextBox1.Value = "" Then Exit Sub
    For i = 1 To Range("A65536").End(xlUp).Row
        If InStr(1, UCase(Cells(i, 1).Value), j) > 0 Then
            Range("C65536").End(xlUp).Offset(1, 0).Value = Cells(i, 1).Value
        End If
    Next i
            Me.TextBox1 = vbNullString
        End If
    End Sub
    thx to all
    Last edited by danusko; 09-30-2009 at 03:35 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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