This worked about a week ago, but it stopped for some reason. I have a checkbox and the below code is supposed to trigger when the cell N89 changes (changes via a formula). Right now, when I try and check the box, it triggers the code and unchecks it. I tried disabling the true/false enable evens and calculation manual/auto to see if it fixed it, but it didn't. Any advice is appreciated!
VBA Code:
Private Sub Worksheet_Calculate()
Set ws = ThisWorkbook.ActiveSheet
If ws.Name Like "Period*" Then
ActiveWorkbook.Save
On Error GoTo ErrorHandler
'Err.Raise vbObjectError + 1000
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
.DisplayStatusBar = False
.EnableEvents = False
Dim Target As Range
Set Target = Range("N89")
Set cboxVariance = ws.CheckBoxes("Variance Wk1")
Set KeyCellsV = Range("N89")
If Not Application.Intersect(KeyCellsV, Range(Target.Address)) _
Is Nothing Then
cboxVariance.Value = xlOff
End If
End With
ErrorExit:
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
.DisplayStatusBar = True
.EnableEvents = True
Exit Sub
ErrorHandler:
MsgBox "The following Error occurred: " & Err.Description
Resume ErrorExit
End With
End If
End Sub