- Sub Macro1()
- Dim arr, i&, rng As Range
- arr = Range("a1").CurrentRegion
- s = UBound(arr, 2)
- [a:g].Interior.ColorIndex = xlNone
- For i = 2 To UBound(arr)
- If arr(i, 7) >= 330 Then
- If rng Is Nothing Then
- Set rng = Cells(i, 1).Resize(1, s)
- Else
- Set rng = Union(rng, Cells(i, 1).Resize(1, s))
- End If
- End If
- Next
- If Not rng Is Nothing Then rng.Interior.ColorIndex = 3
- End Sub
复制代码 |