VBA Copy and Paste Array Formulas

时间:2018-08-22 14:00:29

标签: vba excel-vba

I have an array formula that fills down over 2,000 rows, so of course it slows down the worksheet.

My goal is to write a macro that copies and pastes values as it fills down.

Currently the macro fills down the formula then copies and pastes, which is still taking too long.

This is my current code below:

Sub ArrayFillDown()
    Selection.FormulaArray = "=VLOOKUP(INDEX(keys,MATCH(TRUE,ISNUMBER(SEARCH(keys,RC[2])),0)),KEY!C:C[1],2,0)"
    Range("A2").AutoFill Destination:=Range("A2:A" & Cells(Rows.Count, "B").End(xlUp).Row)
    Range("A2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Value = Selection.Value
End Sub

If you have any recommendations please let me know.

0 个答案:

没有答案