I have a worksheet that populates with some amount of dates in col A and account codes in row 1. I then have a range with is from B3Last Col, Last Row) called MyRange.
I now want to perform an index match array formula in each cell in my range. (The results of the index match can be just the value result, I don't need the formula in the cell if it will slow down the process.
Currently I have found the following, this does work however it takes far too long to process. I really want it to be fully automated as the workbook will be shared and used by others.
Sub setrange()
Dim MyRange As Range
Dim i As Integer
Dim j As Integer
i = Application.WorksheetFunction.CountA(Rows(1).EntireRow.Cells) + 1
j = Application.WorksheetFunction.Count(Columns(1).EntireColumn.Cells) + 2
Set MyRange = Range(Cells(3, 2), Cells(j, i))
Const pullFormula = "=INDEX(Returns!$M:$M,MATCH(Sheet1!B$1&Sheet1!$A3,Returns!$C:$C&Returns!$E:$E,0))/100"
With Sheet1
With MyRange
.Formula = pullFormula
.FormulaArray = .FormulaR1C1
End With
End With
End Sub
I now want to perform an index match array formula in each cell in my range. (The results of the index match can be just the value result, I don't need the formula in the cell if it will slow down the process.
Currently I have found the following, this does work however it takes far too long to process. I really want it to be fully automated as the workbook will be shared and used by others.
Sub setrange()
Dim MyRange As Range
Dim i As Integer
Dim j As Integer
i = Application.WorksheetFunction.CountA(Rows(1).EntireRow.Cells) + 1
j = Application.WorksheetFunction.Count(Columns(1).EntireColumn.Cells) + 2
Set MyRange = Range(Cells(3, 2), Cells(j, i))
Const pullFormula = "=INDEX(Returns!$M:$M,MATCH(Sheet1!B$1&Sheet1!$A3,Returns!$C:$C&Returns!$E:$E,0))/100"
With Sheet1
With MyRange
.Formula = pullFormula
.FormulaArray = .FormulaR1C1
End With
End With
End Sub