Results 1 to 4 of 4

Search by a column, working but very slow after 1000's line

Threaded View

  1. #1
    Registered User
    Join Date
    12-06-2014
    Location
    Maputo
    MS-Off Ver
    2013
    Posts
    4

    Search by a column, working but very slow after 1000's line

    Hello grand community,
    I have 'created' a search on excel (massively with a help of youtube lessons).
    Its rather simple and it works
    I'm doing a job for a firm that has thousands of registries (2,000 +/-) with 44 columns each.

    Private Sub Bot_PesquisarRegistos_Click()
    If PesquisarNO = "" Then 
        ' PesquisarNO it's a textbox, this code its on a button next to the textbox (please, see image attached)
        MsgBox "Field empty, please write a NO number", vbInformation, "Alert"
        PesquisarNO.SetFocus
    Else
        Range("a6").Select ' before A6 there is lots of things that doesn't matter for the search. 
        Do
            ActiveCell.Offset(1, 0).Select
            If ActiveCell.Text = "" Then
                MsgBox "No registry found with the NO:" & PesquisarNO & " supplied. Try again", vbInformation, "Alert"
                PesquisarNO = ""
                PesquisarNO.SetFocus
                Exit Sub
            End If
        Loop Until ActiveCell.Text = PesquisarNO
        CarregaDados ' A subrotine that fills with the data on the current line on the excel sheet into the fields on the form.
        PesquisarNO = ""
        PesquisarNO.SetFocus
    End If
    End Sub
    2.gif

    This is very nice but for the first 1,000 records. After that it starts to take too long (5 seconds + ) to find a line that obeys the condition.
    My question is... Is there a better way to do a search ? a faster way with some internal function that I don't know about.

    Thank you for any help you can give me and thank you for your time in advanced
    Orion
    Last edited by Proditech Orion; 12-18-2014 at 06:00 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. multi-line VBA not working after column order change
    By cmccabe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2014, 05:52 PM
  2. Excel sheet with over 1000 index/match array functions too slow
    By jcmc2112 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-17-2014, 03:17 PM
  3. Search for a line in all Modules in a workbook and add extra line below
    By sans in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2013, 03:17 PM
  4. Creating a find method to search a number between 1000 - 10,000
    By Astroboy142 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-06-2009, 02:25 PM
  5. [SOLVED] Continue formula to LINE 1000 without showing FALSE
    By chieron in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-08-2005, 08:55 AM

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