|
本帖最后由 1003136666 于 2014-10-10 21:44 编辑
麻烦有空的老师给看看,谢谢
- Sub Macro1()
- Dim arr, rng As Range, i&, j%, s&
- ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
- arr = Range("a4").CurrentRegion
- s = UBound(arr) - 1
- For j = 3 To UBound(arr, 2)
- s2 = Application.Average(Cells(5, j).Resize(s)) * 0.9
- For i = 2 To UBound(arr)
- If Cells(i + 3, j) < s2 Then
- If rng Is Nothing Then Set rng = Cells(i + 3, j) Else Set rng = Union(rng, Cells(i + 3, j))
- End If
- Next
- Next
- If Not rng Is Nothing Then rng.Interior.ColorIndex = 3
- End Sub
复制代码数据很多话用代码
|
|