Recalculation on cell changes fails when using VBA function

W

wmauss

Folks,

I have found several threads on very similar issues but the suggestion
did not work for me.

I am using a VBA function in a spread sheet. However, when I change
value in the sheet, Excel does no recalculation for the VBA function
It does recalculate only the cells that contain Excel functions.

It doesn't even recalculate the VBA function after pressing ALT+CTRL+F
as I read in another thread.

Also, putting in the respective worksheet code
Private Sub Worksheet_Change(ByVal Target As Range)
Calculate
End Sub

did not help.
Same for application.volatile and application.calculate which
inserted as first line in the function's body or in main() or in th
above Private Sub.

Any ideas how I can get Excel to recalculate the function upon valu
changes in the spreadsheet??

Werne
 
F

Frank Kabel

Hi
you may post your macro :)
But adding the line
application.volatile
should work

or adding the used cells as parameters for your function should also do
the trick
 
W

wmauss

Hi Frank,

indeed, when I tried it again this morning it worked.
I may add the function anyway later on, it is not on this PC. It simpl
does what I call "conditional sum", summing a column of number
depending on two criterias (rather than just one as in sumif).

Thanks for your help!

Greetings

Thoma
 

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

Top