Recalculate Custom Function

  • Thread starter Thread starter Brad L.
  • Start date Start date
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
 
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 :
 
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)
 
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 :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top