Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 1.54 KB

Excel.Application.Volatile.md

File metadata and controls

48 lines (31 loc) · 1.54 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.Volatile method (Excel)
vbaxl10.chm133230
vbaxl10.chm133230
Excel.Application.Volatile
27047561-9d76-b37d-100d-1c58e6edf494
04/05/2019
medium

Application.Volatile method (Excel)

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. This method has no effect if it's not inside a user-defined function used to calculate a worksheet cell.

Syntax

expression.Volatile (Volatile)

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Volatile Optional Variant True to mark the function as volatile. False to mark the function as nonvolatile. The default value is True.

Example

This example marks the user-defined function My_Func as volatile. The function will be recalculated when any cell in any workbook in the application window changes value. Recalculation of the function is not restricted to changes or calculation cycles on the worksheet for which this function applies. Therefore, use it moderately to avoid calculation lag.

Function My_Func() 
 Application.Volatile 
 ' 
 ' Remainder of the function 
 ' 
End Function

[!includeSupport and feedback]