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
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
This may suit:
If you want to check the type, you could use
It depends on if you mean the data type "Integer", or Integer in the sense of: "A number with no decimal." If you meant the latter, then a quick manual test will suffice (see first example); if you meant the former then there are three ways to look at data types all with various pros and cons: