如果 x 是 VBA 语言中的整数,我如何表达术语? [英] how do I express the term if x is integer in VBA language?
本文介绍了如果 x 是 VBA 语言中的整数,我如何表达术语?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果 x 是 VBA 语言中的整数,我该如何表达?我想编写一个代码,如果 x 是整数,那么它会做一些事情,如果它不是 vba excel,就会做其他事情.
how do I express the term if x is integer in VBA language ? I want to write a code that does something if x is integer and does something else if its not with vba excel.
Sub dim()
Dim x is Variant
'if x is integer Then
'Else:
End Sub
推荐答案
If IsNumeric(x) Then 'it will check if x is a number
如果你想检查类型,你可以使用
If you want to check the type, you could use
If TypeName(x) = "Integer" Then
这篇关于如果 x 是 VBA 语言中的整数,我如何表达术语?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文