Error 1004 - Application-defined or Object-defined error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I do have a 1004 error using the following code. Any Sggestion...I use
similar code in an other macro and it works fine.

ActualToReport = "=SUMIF('Actuels Finance PUID'!C1,''" + ActiveCell.Value +
"'','Actuels Finance PUID'!C" + Trim(Str(ColumnCounter - 2)) + ")"

Worksheets("ReForecast - Detailed").Cells(CurrentRow, ColumnCounter).Formula
= ActualToReport

Thanks,
nde
 
Hi, the SUMIF function takes a range of cells as the first parameter, a
condition or criteria to be satisfied within the first parameter and another
range or cells as the third parameter. The third parameter contains the
actual data to be added. For example, consider the following data.
C D
1 5 200
2 7 300
3 9 400

The formula, SUMIF(c1:c3,">5",d1:d3) will produce the result 700. Please
change your code appropriately.
 
Back
Top