|
我定义了 Do While Cells(i, "A") = 11 And Cells(i, "G") = 1 这个语句, 可在实际中出现了 Cells(i, "G") 等于了 10次 1 之后出现了10次 2 然后又出现了 10次 1 然后又出现了 10次 2 这可怎么办啊???我用的办法是 运行了四次下面的代码 解决了 可我想求教一下有更好的办法么????诚信求教 鞠躬拜谢!!
Dim df As Integer, i As Integer
i = 2
Do While Cells(i, "A") = 11 And Cells(i, "G") = 1
Select Case Cells(i, "N")
Case Is >= 1700
df = "100"
Case Is >= 1600
df = "95"
Case Is >= 1500
df = "90"
Case Is >= 1400
df = "85"
Case Is >= 1300
df = "80"
Case Is >= 1240
df = "78"
Case Is >= 1180
df = "76"
Case Is >= 1120
df = "74"
Case Is >= 1060
df = "72"
Case Is >= 1000
df = "70"
Case Is >= 940
df = "68"
Case Is >= 880
df = "66"
Case 879 To 820
df = "64"
Case Is >= 760
df = "62"
Case Is >= 700
df = "60"
Case Is >= 660
df = "50"
Case Is >= 620
df = "40"
Case Is >= 580
df = "30"
Case Is >= 540
df = "20"
Case Is >= 0
df = "10"
End Select
Cells(i, "O") = df
i = i + 1
Loop
Dim df As Integer, i As Integer
i = 2
Do While Cells(i, "A") = 11 And Cells(i, "G") = 2
Select Case Cells(i, "N")
Case Is >= 1700
df = "100"
Case Is >= 1600
df = "95"
Case Is >= 1500
df = "90"
Case Is >= 1400
df = "85"
Case Is >= 1300
df = "80"
Case Is >= 1240
df = "78"
Case Is >= 1180
df = "76"
Case Is >= 1120
df = "74"
Case Is >= 1060
df = "72"
Case Is >= 1000
df = "70"
Case Is >= 940
df = "68"
Case Is >= 880
df = "66"
Case 879 To 820
df = "64"
Case Is >= 760
df = "62"
Case Is >= 700
df = "60"
Case Is >= 660
df = "50"
Case Is >= 620
df = "40"
Case Is >= 580
df = "30"
Case Is >= 540
df = "20"
Case Is >= 0
df = "10"
End Select
Cells(i, "O") = df
i = i + 1
Loop
Dim df As Integer, i As Integer
i = 2
Do While Cells(i, "A") = 11 And Cells(i, "G") = 1
Select Case Cells(i, "N")
Case Is >= 1700
df = "100"
Case Is >= 1600
df = "95"
Case Is >= 1500
df = "90"
Case Is >= 1400
df = "85"
Case Is >= 1300
df = "80"
Case Is >= 1240
df = "78"
Case Is >= 1180
df = "76"
Case Is >= 1120
df = "74"
Case Is >= 1060
df = "72"
Case Is >= 1000
df = "70"
Case Is >= 940
df = "68"
Case Is >= 880
df = "66"
Case 879 To 820
df = "64"
Case Is >= 760
df = "62"
Case Is >= 700
df = "60"
Case Is >= 660
df = "50"
Case Is >= 620
df = "40"
Case Is >= 580
df = "30"
Case Is >= 540
df = "20"
Case Is >= 0
df = "10"
End Select
Cells(i, "O") = df
i = i + 1
Loop
Dim df As Integer, i As Integer
i = 2
Do While Cells(i, "A") = 11 And Cells(i, "G") = 2
Select Case Cells(i, "N")
Case Is >= 1700
df = "100"
Case Is >= 1600
df = "95"
Case Is >= 1500
df = "90"
Case Is >= 1400
df = "85"
Case Is >= 1300
df = "80"
Case Is >= 1240
df = "78"
Case Is >= 1180
df = "76"
Case Is >= 1120
df = "74"
Case Is >= 1060
df = "72"
Case Is >= 1000
df = "70"
Case Is >= 940
df = "68"
Case Is >= 880
df = "66"
Case 879 To 820
df = "64"
Case Is >= 760
df = "62"
Case Is >= 700
df = "60"
Case Is >= 660
df = "50"
Case Is >= 620
df = "40"
Case Is >= 580
df = "30"
Case Is >= 540
df = "20"
Case Is >= 0
df = "10"
End Select
Cells(i, "O") = df
i = i + 1
Loop
End Sub
|
|