Refresh Excel VBA Function Results
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).
Some more information on the F9 keyboard shortcuts for calculation in Excel
- F9 Recalculates all worksheets in all open workbooks
- Shift+ F9 Recalculates the active worksheet
- Ctrl+Alt+ F9 Recalculates all worksheets in all open workbooks (Full recalculation)
- Shift + Ctrl+Alt+ F9 Rebuilds the dependency tree and does a full recalculation