Results 1 to 7 of 7

Huge data index/match replacement

Threaded View

  1. #4
    Registered User
    Join Date
    11-25-2012
    Location
    hk
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Huge data index/match replacement

    Quote Originally Posted by karedog View Post
    Maybe :
    Sub Test()
      Dim a, b, c As New Collection, i As Long, j As Long, p As Long
      With Sheets("VBA FOR INDEX MATCH IN COL D")
        a = .Range("I1:M" & .Cells(.Rows.Count, "I").End(xlUp).Row).Value
        b = .Range("C1:G" & .Cells(.Rows.Count, "C").End(xlUp).Row).Value
        For i = 2 To UBound(a, 2)
            For j = 2 To UBound(b, 2)
                If a(1, i) = b(1, j) Then a(1, i) = j: Exit For
            Next j
            If Val(a(1, i)) = 0 Then a(1, i) = Empty
        Next i
        For i = 2 To UBound(a, 1)
            On Error Resume Next
               c.Add key:=a(i, 1), Item:=i
            On Error GoTo 0
        Next i
        For i = 2 To UBound(b, 1)
            p = 0
            On Error Resume Next
               p = c(b(i, 1))
            On Error GoTo 0
            If p > 0 Then
               For j = 2 To UBound(b, 2)
                   If Not IsEmpty(a(1, j)) Then b(i, j) = a(p, a(1, j))
               Next j
            End If
        Next i
        .Range("C1").Resize(UBound(b, 1), UBound(b, 2)).Value = b
      End With
    End Sub
    \

    thanks a lot!! but a compile error (invalid or unqulified reference) pops up. i cut the data i'm working and hope it explain more on the purpose..
    there's multiple curency in a contract... so we will keep updating the decimal tab...
    i'm thinking if i was too complicated on the structure/ method??
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. index-match between two huge files
    By is2_egypt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2016, 09:59 AM
  2. [SOLVED] vba replacement for index match array
    By eculver in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2015, 05:39 PM
  3. Problems applying INDEX-MATCH-MATCH function on other data
    By LennartB in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-13-2015, 05:33 AM
  4. Replies: 1
    Last Post: 03-21-2015, 07:46 PM
  5. Replies: 2
    Last Post: 08-30-2014, 02:49 AM
  6. Replies: 3
    Last Post: 05-08-2013, 02:10 PM
  7. Huge replacement formula
    By Falcon Punch in forum Excel General
    Replies: 7
    Last Post: 12-01-2011, 06:10 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