Because you are not double-quoting a string. It should be
Dim sFormula As String
Dim c1 As range
Set c1 = ActiveCell
sFormula = "=" + "SUMIF(" + _
range(c1.Offset(n1 + 2, d - 1), _
c1.Offset(n1 + 2 + m - 1, d - 1)).AddressLocal( _
RowAbsolute:=False, _
ColumnAbsolute:=False) + ",D16," + _
range(c1.Offset(n1 + 2, d), c1.Offset(n1 + 2 + m - 1,
d)).AddressLocal( _
RowAbsolute:=False, _
ColumnAbsolute:=False) + ")"
c1.Offset(n1 + 2 + m + 1, d).Formula = sFormula
if D16 is a cell, or
Dim sFormula As String
Dim c1 As range
Set c1 = ActiveCell
sFormula = "=" + "SUMIF(" + _
range(c1.Offset(n1 + 2, d - 1), _
c1.Offset(n1 + 2 + m - 1, d - 1)).AddressLocal( _
RowAbsolute:=False, _
ColumnAbsolute:=False) + "",D16,"" + _
range(c1.Offset(n1 + 2, d), c1.Offset(n1 + 2 + m - 1,
d)).AddressLocal( _
RowAbsolute:=False, _
ColumnAbsolute:=False) + ")"
c1.Offset(n1 + 2 + m + 1, d).Formula = sFormula
if D16 is text
--
HTH
RP
(remove nothere from the email address if mailing direct)
EXCEL$B!!(BNEWS said:
c1.Offset(n1 + 2 + m + 1, D).Formula = "=" + "SUMIF(" + Range(c1.Offset(n1 +
2, D - 1), c1.Offset(n1 + 2 + m - 1,
D -1)).AddressLocal(RowAbsolute:=False,