|
Sub VBA数组格式化单元格()
Cells.ClearFormats
arr = Range("g2:g" & Cells(Rows.Count, "g").End(xlUp).Row)
For i = 1 To UBound(arr)
If arr(i, 1) >= 330 Then
Set Rng = Cells(i + 1, "g").EntireRow.Range("a1:g1")
n = n + 1
If n = 1 Then Set rngs = Rng Else Set rngs = Union(rngs, Rng)
k = rngs.Address
End If
Next
rngs.Interior.ColorIndex = 3
End Sub |
|