子橘
Sub NgJudge()
Dim DataCount%, COL%, JudNum%, Ng As Boolean
With Sheet1
DataCount = .Range("IV58").End(xlToLeft).Column
If DataCount < 12 Then Exit Sub
Ng = False
For COL = 4 To DataCount - 9
If .Cells(58, COL) > .Cells(58, COL + 1) Then
For JudNum = 0 To 8
If .Cells(58, COL + JudNum) &get; .Cells(58, COL + JudNum + 1) Then
Ng = True
Else
Ng = False
Exit For
End If
Next
ElseIf .Cells(58, COL) < .Cells(58, COL + 1) Then
For JudNum = 0 To 8
If .Cells(58, COL + JudNum) < .Cells(58, COL + JudNum + 1) Then
Ng = True
Else
Ng = False
Exit For
End If
Next
End If
If Ng Then MsgBox "异常发生,第" & COL - 3 & "个点,开始连续9点上升或下降", vbExclamation: Exit Sub
Next
End With
End Sub
高手们,能帮我解释一下这个代码是什么意思吗?SPC统计时用的,连续9个数上升就提示