|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 fzxba 于 2022-12-14 14:46 编辑
- Sub test1()
- Dim ar, i As Long, j As Long, n As Double
- Dim Ran As Range, Target As Range
- With Range("R1")
- i = .CurrentRegion.Rows.Count
- j = .CurrentRegion.Columns.Count
- Set Target = .Offset(i + 1)
- End With
- Set Ran = Target
- With Target.Offset(1).Resize(i, j)
- ar = .Value
- n =-int (- WorksheetFunction.Average(ar) ) '见它处说明,此行改一下,审核真扯淡……
- For i = 1 To UBound(ar)
- For j = 1 To UBound(ar, 2)
- If ar(i, j) > n Then Set Ran = Union(Ran, .Cells(i, j))
- Next
- Next
- .ClearFormats
- End With
- With Ran
- .Interior.Color = vbRed
- .Font.Color = vbWhite
- End With
- Target.Clear
- Set Target = Nothing
- Set Ran = Nothing
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|