|
Sub funxx()
Dim StartLines As Integer
'Dim EndLines As Integer
Dim Value1, Value2 As Integer
Dim BoStartFind As Boolean
'Dim FindStart, FindEnd As Integer
Dim FindCount As Integer
Dim i As Integer
BoStartFind = False
For StartLines = 1 To Sheet1.Range("A1").End(xlDown).Row
'If Not BoStartLines Then
If BoStartFind Or CInt(Sheet1.Cells(StartLines, 1)) Mod 10 = 0 Then
BoStartFind = True
Value1 = CInt(Sheet1.Cells(StartLines, 1))
Value2 = CInt(Sheet1.Cells(StartLines + 1, 1))
If BoStartFind And Value1 + 1 = Value2 Then
FindCount = FindCount + 1
Sheet1.Cells(StartLines, 2) = "ok"
Else
BoStartFind = False
FindCount = 0
Sheet1.Cells(StartLines, 2) = "notok"
End If
Else
Sheet1.Cells(StartLines, 2) = "notok"
End If
If FindCount = 9 Then
'Debug.Print "..........."
Sheet1.Cells(StartLines + 1, 2) = "检测成功"
Sheet1.Cells(StartLines + 1, 1).Interior.Color = RGB(155, 155, 155)
For i = 0 To 8
Sheet1.Cells(StartLines - i, 2) = "检测成功"
Sheet1.Cells(StartLines - i, 1).Interior.Color = RGB(155, 155, 155)
FindCount = 0
Next
StartLines = StartLines + 1
BoStartFind = False
End If
Next
End Sub
|
-
|