Hello
Could anyone tell me what I do wrong here ?
Sub TestSumFormula()
Dim R As Range
Set R = Union([J3:J22], [J25:J34])
MsgBox R.Address(1, 0)
[J35].Formula "=sum(" & R.Address(1, 0) & ")"
End Sub
MsgBox says “J$3:J$22,J$25:J$34” as expected but [J35] disappoints me with an Error 438.
Thanks a lot for any tip or better formula code for “sum” of a Union range, all cells of which are numbers.
Could anyone tell me what I do wrong here ?
Sub TestSumFormula()
Dim R As Range
Set R = Union([J3:J22], [J25:J34])
MsgBox R.Address(1, 0)
[J35].Formula "=sum(" & R.Address(1, 0) & ")"
End Sub
MsgBox says “J$3:J$22,J$25:J$34” as expected but [J35] disappoints me with an Error 438.
Thanks a lot for any tip or better formula code for “sum” of a Union range, all cells of which are numbers.