I am trying to write a macro to saveas a file every time a particular cells value changes I have tried the code below but it will save every time the cell recalculates even if the cell value does not change. I need it to save only when the value changes not every recalculation. please help
VBA Code:
Private Sub Worksheet_Calculate()
newval = Sheets("T,S,W").Range("AH1").Value
If newval <> olval Then
Application.EnableEvents = False
olval = Sheets("T,S,W").Range("AH1").Value
ActiveWorkbook.SaveCopyAs "path.xlsm"
Application.EnableEvents = True
End If
End Sub