E
eggman
I am trying to build a custom function and could use some advice. There is
more to it than this, but at the core what I am trying to do is a custom sum
function that lets you put any number of cell references in the formula.
This is a very simplified version, but if I can get this to work, then I can
get the rest to work.
Thanks in advance
Function MySum(Range1, Optional Range2, Optional Range3, Optional Range4)
For X = 1 to 4
if ismissing(RangeX) then Exit Function Else MySum = MySum +
Cells(RangeX.Row, RangeX.Column)
Next X
more to it than this, but at the core what I am trying to do is a custom sum
function that lets you put any number of cell references in the formula.
This is a very simplified version, but if I can get this to work, then I can
get the rest to work.
Thanks in advance
Function MySum(Range1, Optional Range2, Optional Range3, Optional Range4)
For X = 1 to 4
if ismissing(RangeX) then Exit Function Else MySum = MySum +
Cells(RangeX.Row, RangeX.Column)
Next X