VB Select Case

来源:互联网 发布:xml json弹幕 编辑:程序博客网 时间:2024/06/04 23:17
Sub gantest()


   rr = 10
    ir = 2
 MsgBox ("OK")
 i = Sheets("Sheet1").Cells(rr, 2).Value
  Select Case Sheets("Sheet1").Cells(rr, 2).Value
Case Is < 50
'Print i
MsgBox ("こちらは設置1のデータ")
Case 50 To 60
'Print i ^ 2
MsgBox (i ^ 2)
'MsgBox (i)
MsgBox ("test2です")
Case Is > 60
'Print "wrong!"
MsgBox ("wrong!")




End Select
End Sub