I m trying to speed up my VBA and I think it is because of the 3 columns that have foumulasin them.
I am putting a forumula in cells B2(dl1), C2(dl2), D2(dl3) then autofilling to the last line my code is as follows
/code
dl1 = Application.Match("Deal #1", Rows(1), 0)
dl2 = Application.Match("Deal #2", Rows(1), 0)
dl3 = Application.Match("Deal #3", Rows(1), 0)
With ActiveSheet
LASTROW = .Cells(.Rows.Count, "E").End(xlUp).Row
End With
Cells(2, dl1).Select
Selection.FormulaArray = "=IFERROR(INDEX(C6,MATCH(RC1&R1C2,C1&C5,0)),"""")"
Cells(2, dl2).Select
Selection.FormulaArray = "=IFERROR(INDEX(C6,MATCH(RC1&R1C3,C1&C5,0)),"""")"
Cells(2, dl3).Select
Selection.FormulaArray = "=IFERROR(INDEX(C6,MATCH(RC1&R1C4,C1&C5,0)),"""")"
Range(Cells(2, dl1), Cells(2, dl3)).AutoFill Destination:=Worksheets("Testing").Range(Cells(2, dl1), Cells(LASTROW, dl3))
/code
FYI the formula is writen as follows
{=IFERROR(Index($F:$F), Match( $A2&$B$1,$A:$A&$E:$E,0)),"")}
I am putting a forumula in cells B2(dl1), C2(dl2), D2(dl3) then autofilling to the last line my code is as follows
/code
dl1 = Application.Match("Deal #1", Rows(1), 0)
dl2 = Application.Match("Deal #2", Rows(1), 0)
dl3 = Application.Match("Deal #3", Rows(1), 0)
With ActiveSheet
LASTROW = .Cells(.Rows.Count, "E").End(xlUp).Row
End With
Cells(2, dl1).Select
Selection.FormulaArray = "=IFERROR(INDEX(C6,MATCH(RC1&R1C2,C1&C5,0)),"""")"
Cells(2, dl2).Select
Selection.FormulaArray = "=IFERROR(INDEX(C6,MATCH(RC1&R1C3,C1&C5,0)),"""")"
Cells(2, dl3).Select
Selection.FormulaArray = "=IFERROR(INDEX(C6,MATCH(RC1&R1C4,C1&C5,0)),"""")"
Range(Cells(2, dl1), Cells(2, dl3)).AutoFill Destination:=Worksheets("Testing").Range(Cells(2, dl1), Cells(LASTROW, dl3))
/code
FYI the formula is writen as follows
{=IFERROR(Index($F:$F), Match( $A2&$B$1,$A:$A&$E:$E,0)),"")}