Johnny Thunder
Well-known Member
- Joined
- Apr 9, 2010
- Messages
- 693
- Office Version
- 2016
- Platform
- MacOS
Hello all,
I have a code that creates an array SUMPRODUCT formula and for whatever reason the R1C1 part of the formula is the only thing not working. I am sure I am doing something weird but hopefully someone can spot the mistake and provide a revision.
Here is the line of code:
When I send the line to Debug.Print in the immediate Window, this is what I get, "=IFERROR(SumProduct(ISNUMBER(MATCH(cData,{1256,1261,1265,1811,3702},0)) * (ISNUMBER(MATCH(GData,{7840000,6080000},0)) * (Hdata= R7C & " " & RC5) * DataTable) /1,0)"
So everything seems to be coming incorrectly except for the R1C1 Reference: "Hdata= R7C & " " & RC5"
Any ideas what I am doing wrong?
I have a code that creates an array SUMPRODUCT formula and for whatever reason the R1C1 part of the formula is the only thing not working. I am sure I am doing something weird but hopefully someone can spot the mistake and provide a revision.
Here is the line of code:
Code:
sF1 = "=IFERROR(SumProduct(ISNUMBER(MATCH(cData,{" & arr1 & "},0)) * (ISNUMBER(MATCH(GData,{" & arr2 & "},0)) * (Hdata= R7C & "" "" & RC5 ) * DataTable) / & AmtRep & ,0)"
Cell.Offset(0, x).FormulaR1C1 = sF1 'Drops formula into cell on Summary"
When I send the line to Debug.Print in the immediate Window, this is what I get, "=IFERROR(SumProduct(ISNUMBER(MATCH(cData,{1256,1261,1265,1811,3702},0)) * (ISNUMBER(MATCH(GData,{7840000,6080000},0)) * (Hdata= R7C & " " & RC5) * DataTable) /1,0)"
So everything seems to be coming incorrectly except for the R1C1 Reference: "Hdata= R7C & " " & RC5"
Any ideas what I am doing wrong?