Hey guys,

i have the following code that i wish to use:


PHP Code: 
Range("D3").Select    Selection.FormulaArray _   
     
"=IF(INDEX('Raw Data for PR Dist'!R7C5:R100000C5,MATCH(1,('PR Dist SSD Report'!RC[-3]='Raw Data for PR Dist'!R7C1:R100000C1)*('PR Dist SSD Report'!RC[-2]='Raw Data for PR Dist'!R7C2:R100000C2),0))="""","""",INDEX('Raw Data for PR Dist'!R7C5:R100000C5,MATCH(1,('PR Dist SSD Report'!RC[-3]='Raw Data for PR Dist'!R7C1:R100000C1)*('PR Dist SSD Report'!RC[-2]='Raw Data for" _       " PR Dist'!R7C2:R100000C2),0)))" _        "" 
the problem is the following:

1) The code exceeds 244, thus i need a workaround

2) i want the workaround to autofill till last row starting Cell D2 till the last existing data in Column A1


This was my first workaround but i can not use it to Autofill or copy paste it till last cell.

With Range("D2")
    .FormulaArray = "=IF(A1="""","""",A1)"
    .Replace "A1", "INDEX('Raw Data for PR Dist'!$E$7:$E$100000,MATCH(1,('PR Dist SSD Report'!A3='Raw Data for PR Dist'!$A$7:$A$100000)*('PR Dist SSD Report'!B3='Raw Data for PR Dist'!$B$7:$B$100000),0))"
End With
as the A3 and B3 are not updating as we do down the cells to A4, A5...etc B4,B5...etc