+ Reply to Thread
Results 1 to 2 of 2

Application.Match vs very large data arrays - A.M looses

  1. #1
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    199

    Application.Match vs very large data arrays - A.M looses

    I have a piece of code to find an index into a text array, looking for a line that contains a string match.

    I've learned that Application.Match is fairly useful as long as I know how it behaves. The returned number is always (+1) in the text array, so I have to adjust when that matters. Also, A.M will default to an exact match, but will use wildcards.

    What threw me for a serious loop, is that Application.Match does not play well with very large arrays. I believe it is a memory limitation (but I forget).

    Here is the code I use:
    Please Login or Register  to view this content.
    Today, running this would give me an application mismatch, when I know it works (DIMs are variant where needed, etc.)

    So, here is how I got past that:
    Please Login or Register  to view this content.
    My question is... Should I just use my ugly for-next loop in place of Application.Match, or should I use Application.Match and trap errors (or test the UBound valuse is >= to some specific number)?

    Being lazy, I'm inclined to just use what works.

    I just noticed that I have to use the InStr() function for partial matches.
    Last edited by Rhudi; 10-31-2014 at 05:32 PM. Reason: Again, Typo

  2. #2
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    199

    Re: Application.Match vs very large data arrays - A.M looses

    I've concluded that my solution works. Actually, I can use that to continue looping if I believe that I will find multiple matches.

    In fact, I also use Filter() to make smaller arrays, when I know there will be multiple hits of the data for which I'm searching.

    As an example, within a Cisco router dump, using filter to match "neighbor a.b.c.d" will build me a smaller array with all the matching neighbor statements. From that, i can loop-count through the smaller array, then use the lager array-count-through to find specific sections within the source data.

    More often than not, asking you guys in-forum how to do this stuff slows me down enoug to actually think about what I need to accomplish. Thanks forum!

+ 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. [SOLVED] Using Max with Index & Match across two arrays of data
    By mike_vr in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-06-2013, 10:34 AM
  2. VBA to loop correlation between two arrays in large data set
    By amedhussaini in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2009, 08:20 PM
  3. Breaking Links in chart looses some data
    By freud1 in forum Excel General
    Replies: 1
    Last Post: 03-05-2009, 07:36 AM
  4. How do I set up Data entry to match My Application Form
    By Mr. Ziggy in forum Excel General
    Replies: 11
    Last Post: 04-06-2006, 01:50 PM
  5. VBA - Large Arrays
    By ajocius in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-03-2005, 01:05 PM

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