|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub TEST()
Dim arr, i&, j&, sScore As Single, rng As Range
Application.ScreenUpdating = False
ActiveSheet.Cells.Interior.ColorIndex = 0
ActiveSheet.Cells.Font.ColorIndex = 0
ActiveSheet.Cells.Font.Bold = False
arr = Range(Cells(Rows.Count, "M").End(xlUp), "F2")
Set rng = Range(Cells(Rows.Count, "M").End(xlUp), "F2")
For i = 2 To 5 'ubound(arr,2)
sScore = Application.Average(Application.Index(arr, , i))
For j = 1 To UBound(arr)
If arr(j, i) > sScore Then
rng.Cells(j, i).Font.Color = vbRed
rng.Cells(j, i).Font.Bold = True
rng.Cells(j, i).Interior.Color = vbYellow
End If
Next j
Next i
Application.ScreenUpdating = True
Beep
End Sub
|
评分
-
2
查看全部评分
-
|