Recalculate Custom Function

B

Brad L.

I created a custom function in VBA but when I use it in a cell it doesn't
recalculate unless I edit the cell. I have Excel set for automatic
calcualtion. It doesn't recalculate when I press F9. What am I doing
wrong?

Thanks
 
F

FxM

Hi Brad,

If you want to force recalcualtion of function every time Excel
calculates, add the following line just after the custom function name:

Public Function blabla(...)
application.volatile '<<<<<< to be added

HTH

@+
FxM





Brad L. a écrit :
 
F

Frank Kabel

Hi
you may add the cell references in your custom function as parameter.
Another option would be to add
application.volatile
at the beginning of your code.

You may post your user defined function (IMHO the first option is the
better one)
 
B

Brad L.

Thanks, that did the trick.

--
Brad
FxM said:
Hi Brad,

If you want to force recalcualtion of function every time Excel
calculates, add the following line just after the custom function name:

Public Function blabla(...)
application.volatile '<<<<<< to be added

HTH

@+
FxM





Brad L. a écrit :
 
Top