+ Reply to Thread
Results 1 to 6 of 6

Searching Spreadsheet Based on Listbox Information

  1. #1
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Searching Spreadsheet Based on Listbox Information

    In my code below i have a loop that searches through my database for The First and Last Name of a selected person in the list box and determines that the person selected in a list box is actually the person in the worksheet.

    My question is when i get large amounts of data into the spreadsheet will this loop greatly slow excel down. Is there a better way to link a list box to the worksheet??

    Column "A" = First Name
    Column "B" = Last Name
    "X" - returns row number of person

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    04-14-2010
    Location
    NZ
    MS-Off Ver
    2007,2010
    Posts
    86

    Re: Searching Spreadsheet Based on Listbox Information

    Perhaps using an autofilter and an If statement to catch if the filter matched anything..

    So instead of your loop, you could try

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Searching Spreadsheet Based on Listbox Information

    Thanks For the Response Deamo.

    Not quite what i was looking for, not a fan of using autofilter, do you know if i could find the row using ".find()"

    example:
    Please Login or Register  to view this content.

    except have a second criteria within find() using my last name value below

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Searching Spreadsheet Based on Listbox Information

    Any Ideas Guys?

    Regards.

  5. #5
    Registered User
    Join Date
    04-14-2010
    Location
    NZ
    MS-Off Ver
    2007,2010
    Posts
    86

    Re: Searching Spreadsheet Based on Listbox Information

    Find may work, i think you'd still need a loop - in cases of finding the firstname, and the lastname doesn't match

    To catch your second name you could try something like

    I'll have a play and see what i can get working

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-14-2010
    Location
    NZ
    MS-Off Ver
    2007,2010
    Posts
    86

    Re: Searching Spreadsheet Based on Listbox Information

    Here's a find with a loop

    Please Login or Register  to view this content.

+ Reply to Thread

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