PDA

View Full Version : Solved: Assigning formula to cell glitch?



CatDaddy
06-21-2011, 02:45 PM
dash.Cells(i, 3).FormulaR1C1 = "=SUMPRODUCT((ALL!A:A=""" & MKPArray(i) & """)*(ALL!C:C= ""Y""))"

yeilds formula in cell:

=SUMPRODUCT((ALL!A: (A)="Criteria")*(ALL!C:C="Y"))

why would the first part show up wrong but the second part no problem...

Bob Phillips
06-21-2011, 03:06 PM
Because you are using an A1 formula, but setting an R1C1 property.

Try



dash.Cells(i, 3).Formula = "=SUMPRODUCT((ALL!A:A=""" & MKPArray(i) & """)*(ALL!C:C=""Y""))"

CatDaddy
06-21-2011, 03:28 PM
Because you are using an A1 formula, but setting an R1C1 property.

Try



dash.Cells(i, 3).Formula = "=SUMPRODUCT((ALL!A:A=""" & MKPArray(i) & """)*(ALL!C:C=""Y""))"

thank you!:beerchug: