When you say "Both lines of code work separately ..." I doubt that this is quite
the case. Certainly, the "Cells (1, 2)" line doesn't work in my Excel (2000)
even if I comment out the "boomLength =" line.
There is nothing wrong with the "Cells (1, 2)" line itself. If I put it into a
separate subroutine, it works fine. It's where you've got it that is the
problem. The function you have defined is returning a value for insertion in a
cell. That is all it is allowed to do. It can't plant a value in a different
cell. Excel terminates execution of the function at the point it tries to do
something illegal, and execution continues with whatever was running when the
function was invoked.
In summary, functions called from cell formulae can't change other cells.