ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   function calls (https://www.excelbanter.com/excel-programming/284562-function-calls.html)

Claude

function calls
 
Hi all

What is the logic behind the number of times a function is
called? A simple example to illustrate:

Function add(a, b)
MsgBox ("add")
add = a + b
End Function

In the worksheet I have:
A1: 1
A2: 2
A3: =add(A1;A2)

If I change the value in cell A1, the function runs 3
times. Why? Is it possible to force a certain function to
run only once?

Bob Phillips[_6_]

function calls
 
Only runs once for me.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Claude" wrote in message
...
Hi all

What is the logic behind the number of times a function is
called? A simple example to illustrate:

Function add(a, b)
MsgBox ("add")
add = a + b
End Function

In the worksheet I have:
A1: 1
A2: 2
A3: =add(A1;A2)

If I change the value in cell A1, the function runs 3
times. Why? Is it possible to force a certain function to
run only once?




No Name

function calls
 
Just realised my file had a reference to an external
object library. Looks like this was messing things up.
Thanks for helping me further!

-----Original Message-----
Only runs once for me.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Claude" wrote in

message
...
Hi all

What is the logic behind the number of times a function

is
called? A simple example to illustrate:

Function add(a, b)
MsgBox ("add")
add = a + b
End Function

In the worksheet I have:
A1: 1
A2: 2
A3: =add(A1;A2)

If I change the value in cell A1, the function runs 3
times. Why? Is it possible to force a certain function

to
run only once?



.



All times are GMT +1. The time now is 10:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com