Results 1 to 5 of 5

Compare 2 arrays using Match

Threaded View

  1. #1
    Registered User
    Join Date
    09-27-2010
    Location
    Adelaide
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Compare 2 arrays using Match

    Hi All,
    I have two arrays which I want to compare, using Match.
    The code below is what i have so far, but it is failing on the Redim Preserve ArrNot(k) line, with error "Run-time error '13' Type Mismatch"
    All arrays are defined as Variant.
    Just not sure how to proceed with debugging.

    Cheers,
    Skimmer333


        'compare 2 arrays. Values in Arr and NOT in ArrResults need to output
        l = 0
        k = 0
        On Error GoTo Output
        For l = LBound(Arr)))To UBound(Arr())
            j = Application.Match(Arr(l), ArrResults(), 0)
        Next l
        
    Output:
        ReDim Preserve ArrNot(k)
        ArrNot(k) = Arr(l)
        k = k + 1
        Range("J1").Select
            If l = UBound(Arr()) Then
            For k = 1 To UBound(ArrNot())
                ActiveCell.Value = ArrNot(k)
            Next k
        Else
            Resume Next
        End If
    Last edited by skimmer333; 10-06-2010 at 08:25 PM.

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