Excel VBA使用if语句比较变量

时间:2019-07-29 18:11:41

标签: excel vba

在for循环语句中,我想插入类似If a = 5/2 * b Then... End If的内容,但是会出现“运行时错误'13'类型不匹配”。有什么办法可以在VBA中做到这一点?

 Dim a as Double
 Dim b as Double
 Dim rCell As Range

 For i = 0 to 40
 a = b
 a = Application.WorksheetFunction.Min((Cell.Value + i * 5/8), 0.8) 
 If a = b Then 
 Exit For
 End If
 R  = R & "," & thisResult

 Next

我想将If a = b Then更改为If a = 5/2 * b Then

0 个答案:

没有答案