Hi guys, hope you can help, I'm sure I'm just making a simple error somewhere.
I have the following code which defines several areas for use in a SUMPRODUCT formula, which works fine.
However, I am getting an issue with the actual sumproduct part. If I type in the formula in excel, then no worries, but VBA doesn't like it.
Any ideas?
I have the following code which defines several areas for use in a SUMPRODUCT formula, which works fine.
However, I am getting an issue with the actual sumproduct part. If I type in the formula in excel, then no worries, but VBA doesn't like it.
Any ideas?
Code:
Range("A2").Select
Range(selection, selection.End(xlDown)).Select
Set 1_Area = Range(selection, selection.End(xlDown))
Range("B2").Select
Range(selection, selection.End(xlDown)).Select
Set 2_Area = Range(selection, selection.End(xlDown))
Range("C2").Select
Range(selection, selection.End(xlDown)).Select
Set 3_Area = Range(selection, selection.End(xlDown))
Range("G2").Select
ActiveCell.Formula = Sumproduct((selection.Offset(0, -6) = 1_Area) * (selection.Offset(0, -4) = 2_Area) * (3_Area))