Hi,
I've created a worksheet that has the following array index formula:
=IFERROR(INDEX('True Prelims'!$B:$I,SMALL(IF('True Prelims'!$I:$I=Table!$A$1,ROW('True Prelims'!$I:$I)),ROW('True Prelims'!2:2)),1),"")
Basically it works but is awfully slow when run on VBA and I was wondering if anyone could help me speed it up please? I am using the following VBA code:
Range("B3").Select
Selection.FormulaArray = _
"=IFERROR(INDEX('True Prelims'!C2:C9,SMALL(IF('True Prelims'!C9=Table!R1C1,ROW('True Prelims'!C9)),ROW('True Prelims'!R[-1])),1),"""")"
Selection.AutoFill Destination:=Range("B3:B" & lastrow), Type:=xlFillDefault
Range("B3:B" & lastrow).Select
ActiveSheet.Range("B3:B" & lastrow).RemoveDuplicates Columns:=1, Header:=xlNo
In short I want it to pull all the data in a list that follows two separate criteria, ($A$1 and $B2), however I would like it to only pull each data point once as they are recurring and it would give me a very large list.
All help is greatly appreciated as I am a bit of a VBA rookie
Thanks!
I've created a worksheet that has the following array index formula:
=IFERROR(INDEX('True Prelims'!$B:$I,SMALL(IF('True Prelims'!$I:$I=Table!$A$1,ROW('True Prelims'!$I:$I)),ROW('True Prelims'!2:2)),1),"")
Basically it works but is awfully slow when run on VBA and I was wondering if anyone could help me speed it up please? I am using the following VBA code:
Range("B3").Select
Selection.FormulaArray = _
"=IFERROR(INDEX('True Prelims'!C2:C9,SMALL(IF('True Prelims'!C9=Table!R1C1,ROW('True Prelims'!C9)),ROW('True Prelims'!R[-1])),1),"""")"
Selection.AutoFill Destination:=Range("B3:B" & lastrow), Type:=xlFillDefault
Range("B3:B" & lastrow).Select
ActiveSheet.Range("B3:B" & lastrow).RemoveDuplicates Columns:=1, Header:=xlNo
In short I want it to pull all the data in a list that follows two separate criteria, ($A$1 and $B2), however I would like it to only pull each data point once as they are recurring and it would give me a very large list.
All help is greatly appreciated as I am a bit of a VBA rookie
Thanks!