展开全部
Sub s()
n = Cells(Rows.Count, 11).End(3).Row
cl = 0
For i = 22 To n
For j = 11 To 14
For k = 11 To 14
If Cells(i, j) = Cells(i - 1, k) Then cl = 0: GoTo 100
Next: Next
If cl = 0 Then
cl = 4
Cells(i, 11).Resize(1, 4).Interior.ColorIndex = cl
Else
cl = 6
Cells(i - 1, 11).Resize(2, 4).Interior.ColorIndex = cl
End If
100
Next
End Sub
追问
修改为199 To 204倒一为范围时如何修改
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询