Consulting

Results 1 to 2 of 2

Thread: Solved: application.volatile

  1. #1
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    291
    Location

    Solved: application.volatile

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •