PDA

View Full Version : Solved: application.volatile



philfer
02-06-2008, 12:26 PM
Hi,

I saw this line on a piece of code I printed from this forum.

Can anyone tell me what it does and why it is used and needed?

Cheers
Phil

xld
02-06-2008, 01:12 PM
Direct from VBA help, which is also available to you

Marks a user-defined function as volatile. A volatile function must be recalculated whenever calculation occurs in any cells on the worksheet. A nonvolatile function is recalculated only when the input variables change.

It is often used unnecessarily because the coder doesn't pass the effected range as an argument, but hardcodes it in the function. Only really required on functionality that doesn't trigger a recalculation.