ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Recalculate Custom Function (https://www.excelbanter.com/excel-programming/298874-recalculate-custom-function.html)

Brad L.

Recalculate Custom Function
 
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

--
Brad



FxM[_2_]

Recalculate Custom Function
 
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 :

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


Frank Kabel

Recalculate Custom Function
 
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)


--
Regards
Frank Kabel
Frankfurt, Germany


Brad L. wrote:
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



Brad L.

Recalculate Custom Function
 
Thanks, that did the trick.

--
Brad
"FxM" wrote in message
...
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 :

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





All times are GMT +1. The time now is 01:02 PM.

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