- Sub test()
- a = Round(Application.InputBox("输入成绩下限"))
- b = Round(Application.InputBox("输入成绩上限"))
- If a > b Then
- t = a
- a = b
- b = t
- End If
- cnt = 0
- For r = 3 To 100
- If a <= Cells(r, 2).Value And Cells(r, 2).Value <= b Then
- cnt = cnt + 1
- End If
- Next
- MsgBox (a & "分和" & b & "分之间共有" & cnt & "个")
- End Sub
复制代码 回复 3# mikehill111 |