+ Reply to Thread
Results 1 to 5 of 5

Filtering an array - error when there is no longer a match in the array

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,285

    Filtering an array - error when there is no longer a match in the array

    A userform for checking phone numbers displays the possible matches in a listbox. Unlike the filtered range I was using before this method doesn't clear the listbox when there is no longer a match but errors leaving the last matches in the listbox.

    Is there a way to catch this error? I assume its because the nwnumlst array is empty when there is no longer a match.
    Any help appreciated



    Please Login or Register  to view this content.
    Last edited by nigelog; 12-17-2018 at 11:16 AM.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    7,279

    Re: Filtering an array - error when there is no longer a match in the array

    If there aren't any matches, ii will be 0 so you can just test for that before doing anything else.
    Rory

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,285

    Re: Filtering an array - error when there is no longer a match in the array

    Thanks Rory
    Please Login or Register  to view this content.
    does what is required

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    7,279

    Re: Filtering an array - error when there is no longer a match in the array

    LB_00.Clear would be simpler.

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,285

    Re: Filtering an array - error when there is no longer a match in the array

    I tried that first Rory but it did not affect listbox for some reason, Ill try again
    Edit: I had
    Please Login or Register  to view this content.
    Last edited by nigelog; 12-17-2018 at 11:29 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-22-2018, 01:47 AM
  2. Replies: 3
    Last Post: 04-02-2016, 08:16 PM
  3. [SOLVED] Array Match and Return value upon multiple array match criteria
    By VegetaOSX in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-05-2015, 05:50 AM
  4. [SOLVED] Array Filtering for Lists Using Index Match
    By nickmessick1 in forum Excel General
    Replies: 5
    Last Post: 08-15-2014, 08:36 PM
  5. [SOLVED] New to arrays-how do I build new array while filtering first array?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-03-2013, 05:59 AM
  6. [SOLVED] Populate Listbox with all rows of a dynamic array where elements of a single array match.
    By Tayque_J_Holmes in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-07-2012, 04:54 AM
  7. Converting 3x10 array to a 1X30 array to run a Match formula
    By NBVC in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-08-2009, 07:45 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