Good evening to everybody.
I'd like to check the value of a cell with the previous one stored and, if the value has changed, I need to reset two other cells.

This is my code

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Static precedente
If Not Intersect(Range("foglio1!b2"), Target) Is Nothing Then
    If Range("foglio1!b2").Value <> precedente Then
        'MsgBox precedente
        'MsgBox Range("foglio1!b2").Value
        Range("foglio1!b5").Value = 0
        Range("foglio1!b6").Value = 0
        precedente = Range("foglio1!b2").Value
End If
End If
End Sub
It seems to work when the file is already opened. However if I close it and reopen it, even though I rewrite in the cell the same value, the other cells are set to 0. I add the msgboxes and I've understood that the problem is that the precedente variable has no value. How can I store it to make comparison as soon as I open the file? Thanks in advance.