Results 1 to 16 of 16

Array looping, increase speed of array macro

Threaded View

  1. #1
    Registered User
    Join Date
    11-22-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    11

    Array looping, increase speed of array macro

    I have two sheets, the array macro below detects the last row, then indexes column D, then matches data from column A on Sheet1 to column A on Sheet2 and matches column B on sheet 1 to column E on Sheet2. Then it returns the corresponding value from the indexed column to column G on Sheet1 if the value exists. The macro works fine however I am not advanced enough to make it work faster. Sheet2 contains over 270K rows to search through and it takes quite a long time with 50k rows on Sheet1. Is there a way to make this loop through the records to speed up the process? or in general make the returns faster?
    Sub Macro4()
    
    Range("G2").Select
    Dim Lastrow As Long
    Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
    Selection.FormulaArray = _
    "=INDEX(Sheet2!R8C4:R280007C4, MATCH(1,(RC[-6]=Sheet2!R8C1:R280007C1)*(RC[-5]=Sheet2!R8C5:R280007C5),0))"
    Selection.AutoFill Destination:=Range("G2:G" & Lastrow), Type:=xlFillDefault
    Range("G2:G280007").Select
    
    End Sub
    Last edited by Leith Ross; 11-22-2013 at 01:41 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. speed up sum if array formula with VBA??
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-30-2013, 01:32 PM
  2. How to speed up this macro? How to use an array?
    By djvino in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2012, 07:39 AM
  3. Speed up max if array
    By reddwarf in forum Excel General
    Replies: 9
    Last Post: 03-02-2011, 08:20 AM
  4. Will an Array speed this up?
    By Mase in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2005, 06:53 AM
  5. [SOLVED] Increase macro speed?
    By Valeria in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-14-2005, 05:06 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