VBA Vérifiez si la variable est un nombre entier

'Two different ways to check if a double is assigned a whole number:

Function IsWholeNumber(n#) As Boolean
    IsWholeNumber = 0 = InStr(n, ".")
End Function

Function IsWholeNumber(n#) As Boolean
    IsWholeNumber = n = Int(n)
End Function

-------------------------------------------------------------

MsgBox IsWholeNumber(123)         '<---displays: True
MsgBox IsWholeNumber(123.001)     '<---displays: False


Excel Hero