刷新Excel VBA功能结果 [英] Refresh Excel VBA Function Results
本文介绍了刷新Excel VBA功能结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
你应该使用 Application.Volatile
在你的函数的顶部:
函数doubleMe(d)
Application.Volatile
doubleMe = d * 2
结束函数
每当工作簿将重新评估更改(如果您的计算设置为自动)。
Does anyone know how I can get a user-defined function to re-evaluate itself (based on changed data in the spreadsheet)? I've tried F9 and Shift+F9, but those don't work. The only thing that seems to work is editing the cell with the function call and then pressing Enter. Any ideas? I seem to remember being able to do this...
解决方案
You should use Application.Volatile
in the top of your function:
Function doubleMe(d)
Application.Volatile
doubleMe = d * 2
End Function
It will then reevaluate whenever the workbook changes (if your calculation is set to automatic).
这篇关于刷新Excel VBA功能结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文