R
Robert
Calc mode Manual
J10140:AK10140= Dates
I10141:I10449 = Sales types in groups
J10141:AK10449 sumproduct formulas extracting data from a
Database of 10000 rows.
I recorded a macro by merely pressing F2 and ENTER for each cell from the
start row to the last row. Sample here is only for row 10141 to row 10156.
Actual is upto Row 10449 (25 pages in MSWord). Can someone comment on this
and help me with e me a looping VBA code. Have not resorted to autofilter as
the summarised Data need to follow through for other calculations. Thank you.
ActiveCell.FormulaR1C1 = "=SalesSummary"
Range("J10141").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10142").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10143").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10144").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10145").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10146").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10147").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10148").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-7]C:R[-1]C)" ‘TOTAL FOR GROUP
Range("J10149").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10150").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10151").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10152").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10153").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10154").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10155").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10156").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-7]C:R[-1]C)" ‘TOTAL FOR GROUP
J10140:AK10140= Dates
I10141:I10449 = Sales types in groups
J10141:AK10449 sumproduct formulas extracting data from a
Database of 10000 rows.
I recorded a macro by merely pressing F2 and ENTER for each cell from the
start row to the last row. Sample here is only for row 10141 to row 10156.
Actual is upto Row 10449 (25 pages in MSWord). Can someone comment on this
and help me with e me a looping VBA code. Have not resorted to autofilter as
the summarised Data need to follow through for other calculations. Thank you.
ActiveCell.FormulaR1C1 = "=SalesSummary"
Range("J10141").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10142").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10143").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10144").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10145").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10146").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10147").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10148").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-7]C:R[-1]C)" ‘TOTAL FOR GROUP
Range("J10149").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10150").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10151").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10152").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10153").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10154").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10155").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(--(R6C6:R10006C6=RC9),--(R6C4:R10006C4=R10140C),R6C32:R10006C32)"
Range("J10156").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-7]C:R[-1]C)" ‘TOTAL FOR GROUP