Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Abbie Cohen   on Nov 28 In MS Office Category.

  
Question Answered By: Aran Boonliang   on Nov 28

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.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on calling a sub routine Or get search suggestion and latest updates.


Tagged: