|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
学习了,
Sub dengji()
Application.ScreenUpdating = False '关闭屏幕刷新
Dim ary1 As Range
Dim ary()
p = Sheets("成绩").[a65536].End(xlUp).Row
ReDim ary(1 To 10)
For j0 = 1 To 10
ary(j0) = Sheets("标准").Cells(j0 + 1, 2)
Next j0
For j = 4 To 13
mf = ary(j - 3)
For i = 3 To p
If Cells(i, j) >= 0.9 * mf And Cells(i, j) <= mf Then
Cells(i, j + 15) = "A+"
ElseIf Cells(i, j) >= 0.8 * mf And Cells(i, j) < 0.9 * mf Then
Cells(i, j + 15) = "A"
ElseIf Cells(i, j) >= 0.7 * mf And Cells(i, j) < 0.8 * mf Then
Cells(i, j + 15) = "B+"
ElseIf Cells(i, j) >= 0.6 * mf And Cells(i, j) < 0.7 * mf Then
Cells(i, j + 15) = "B"
ElseIf Cells(i, j) >= 0.5 * mf And Cells(i, j) < 0.6 * mf Then
Cells(i, j + 15) = "C+"
ElseIf Cells(i, j) >= 0.3 * mf And Cells(i, j) < 0.5 * mf Then
Cells(i, j + 15) = "C"
ElseIf Cells(i, j) >= 0 And Cells(i, j) < 0.3 * mf Then
Cells(i, j + 15) = "D"
End If
Next i
Next j
Application.ScreenUpdating = True '关闭屏幕刷新
End Sub |
|