我想检查一下数据类型:Cells(2, 1).Value
即“这里有什么?”以下。
我尝试了名称(整数/长整型等),但似乎不接受。
If TypeName(Cells(r, 1).Value) = "WHAT GOES HERE?" Then
MsgBox "Yes"
Else
MsgBox "No"
End If
好吧,看看显示可能的返回值表
String Returned Variable
-------------------------------------------------------------------
Object type An object whose type is objecttype
Byte Byte value
Integer Integer
Long Long integer
Single Single-precision floating-point number
Double Double-precision floating-point number
Currency Currency value
Decimal Decimal value
Date Date value
String String
Boolean Boolean value
Error An error value
Empty Uninitialized
Null No valid data
Object An object
Unknown An object whose type is unknown
Nothing Object variable that doesn't refer to an object
In addition you can also see the above table by using the built-in help (credit goes to Axel Richter). To quickly jump to the according page, select the function and press F1 or navigate to the help page via the object browser like so:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)