|
Sub 雄鹰()
Dim r
On Error Resume Next
Application.ScreenUpdating = False
t = Timer
r = Cells(Rows.Count, 1).End(xlUp).Row
Range("e11:t" & r).Interior.ColorIndex = 0
i = 11
Dim g1 As Range
Dim g2 As Range
Dim g3 As Range
Dim g4 As Range
For i = i To r '遍历每一行数据
y = 1: x = 1
Do While y < 7
Set g1 = Range("e" & i & ":t" & i).SpecialCells(xlCellTypeFormulas, 1)
Set g2 = Range("e" & i + x & ":t" & i + x).SpecialCells(xlCellTypeFormulas, 1)
Set g3 = Range("e" & i + x + 1 & ":t" & i + x + 1).SpecialCells(xlCellTypeFormulas, 1)
Set g4 = Range("e" & i + x + 2 & ":t" & i + x + 2).SpecialCells(xlCellTypeFormulas, 1)
If g1 > g2 And g3 > g4 And (g1.Column - g2.Column) = (g3.Column - g4.Column) And (g1.Row - g3.Row) = (g2.Row - g4.Row) Or _
g1 < g2 And g3 < g4 And (g2.Column - g1.Column) = (g4.Column - g3.Column) And (g3.Row - g1.Row) = (g4.Row - g2.Row) Then
g1.Interior.ColorIndex = 14
g2.Interior.ColorIndex = 14
g3.Interior.ColorIndex = 14
g4.Interior.ColorIndex = 14
End If
y = y + 1
x = x + 1
Loop
Next i
Application.ScreenUpdating = True
MsgBox Format(Timer - t, "0.00") & "秒"
End Sub
|
评分
-
查看全部评分
|