【发布时间】:2012-07-20 16:46:09
【问题描述】:
问题是!=在excel vba中不能作为函数工作。
我希望能够使用
If strTest != "" Then 而不是If strTest = "" Then
除了!=,还有其他方法吗?
我模仿!=的功能是
Sub test()
Dim intTest As Integer
Dim strTest As String
intTest = 5
strTest = CStr(intTest) ' convert
Range("A" + strTest) = "5"
For i = 1 To 10
Cells(i, 1) = i
If strTest = "" Then
Cells(i, 1) = i
End If
Next i
End Sub
【问题讨论】:
-
您确定是
!=而不是<>? -
您的问题是什么?为什么
!=在vba中不起作用,或者vba中的不等式运算符是什么?
标签: excel vba function syntax inequality