Skip to content
Discussion options

You must be logged in to vote

You are not doing anything wrong - you are seeing normal behaviour for any function in Excel, unrelated to the 'Volatile' concept.
Excel recalculates the sheet when making structural changes like adding or deleting a row or column.

Compare the behaviour of a VBA function like this:

Function Increment()
    Static i As Integer
    
    i = i + 1
    Increment = i 
End Function

With a volatile function like =RAND(), putting both into a sheet.

You'll see that only the volatile function =RAND() calculates when you edit some unrelated cell on the sheet, but both calculate if you add a row.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@simemese
Comment options

Answer selected by simemese
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants