VBACASE语句
(2020-08-25 08:53:16)
标签:
it |
分类: office技巧 |
Case语句的语法如下:
Select Case 测试表达式
Case Is 条件1
如果条件1为真时执行的语句
Case Is 条件2
如果条件2为真时执行的语句
Case Is 条件N
如果条件N为真时执行的语句
End Select
例如,我们来比较几个数字:
Select Case myNumber
Case Is <10
MsgBox "The number is less than 10"
Case 11
MsgBox "You entered eleven."
Case Is >=100
MsgBox "The number is greater than or equal to 100."
Case Else
MsgBox "The number is between 12 and 99."
End Select
if f=700 then
end if
If f > 700 Then
Select Case areatype
Case "DU"
R = Int(Application.WorksheetFunction.Power(10, (mapl - (46.3
+ 33.9 * Application.WorksheetFunction.Log(f) - 13.82 *
Application.WorksheetFunction.Log(hb) - ((1.1 *
Application.WorksheetFunction.Log(f) - 0.7) * hm - (1.56 *
Application.WorksheetFunction.Log(f) - 0.8)) + 3)) / (44.9 - 6.55 *
Application.WorksheetFunction.Log(hb))) * 1000)
Case "UR"
。。。。
Case "SU"
。。。。
Case "RU"
。。。。
End Select
End If
前一篇:VBA输入变量