I am trying to run the following code and I can't get it to fire. It watches 3 different cells for them to turn to "0" and when one of them does it should enter the current time into one of three different ranges based on which cell turned to "0". It's basically a stop clock for 3 different systems. Can anyone tell me why this isn't working please?
VBA Code:
Private Sub Worksheet_Change5(ByVal Target5 As Range)
Application.EnableEvents
Application.Calculation = xlCalculationAutomatic
If Intersect(Target, rangeN13toN15) Is Nothing Then
Set N13 = Cells.Find(What:="0", LookIn:=xlValues)
Set N14 = Cells.Find(What:="0", LookIn:=xlValues)
Set N15 = Cells.Find(What:="0", LookIn:=xlValues)
Dim wksht1 As Worksheet
Dim On5 As Range
Dim stp5 As Range
Set wksht1 = Sheets("Nucomat_Dashboard")
Set stp5 = wksht1.Range("AB1:AB9").Find(What:="", After:=("AB1"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlColumns, SearchDirection:=xlNext)
If N13.Value = 0 Then
stp5.End(xlNext).Value = Format(Now(), "hh:mm")
Else
End If
Set stp6 = wksht1.Range("AB10:AB16").Find(What:="", After:=("AB10"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlColumns, SearchDirection:=xlNext)
If N14.Value = 0 Then
stp5.End(xlNext).Value = Format(Now(), "hh:mm")
Else
End If
Set stp7 = wksht1.Range("AB18:AB24").Find(What:="", After:=("AB18"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlColumns, SearchDirection:=xlNext)
If N15.Value = 0 Then
stp7.End(xlNext).Value = Format(Now(), "hh:mm")
Else
End If
With Application
.EnableEvents = True
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End Sub