|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub test()
- S1 = Timer
- Range("O2:U1000") = ""
- For i = 2 To Range("m65536").End(xlUp).Row
- If Val(Cells(i, 22)) > 0 Then
- If Val(Cells(i, 13)) > Val(Cells(i, 14)) Then
- If Val(Cells(i, 13)) > 6 And Val(Cells(i, 14)) > 6 Then
- Cells(i, 19) = 1: Cells(i, 20) = 1: Cells(i, 21) = 1
- ElseIf Val(Cells(i, 13)) > 6 And Val(Cells(i, 14)) < 7 Then
- Cells(i, 18) = 1: Cells(i, 17) = 1: Cells(i, 16) = 1
- ElseIf Val(Cells(i, 13)) < 7 And Val(Cells(i, 14)) < 7 Then
- Cells(i, 18) = 1: Cells(i, 17) = 1: Cells(i, 16) = 1
- End If
- End If
- If Val(Cells(i, 13)) < Val(Cells(i, 14)) Then
- If Val(Cells(i, 13)) > 6 And Val(Cells(i, 14)) > 6 Then
- Cells(i, 19) = 1: Cells(i, 20) = 1: Cells(i, 21) = 1
- ElseIf Val(Cells(i, 13)) < 7 And Val(Cells(i, 14)) < 7 Then
- Cells(i, 16) = 1: Cells(i, 17) = 1: Cells(i, 18) = 1
- ElseIf Val(Cells(i, 13)) < 7 And Val(Cells(i, 14)) > 6 Then
- Cells(i, 16) = 1: Cells(i, 17) = 1: Cells(i, 18) = 1
- End If
- End If
- End If
- Next i
- MsgBox "宏本次运行消耗时间" & Timer - S1 & "秒!"
- End Sub
复制代码 |
|