Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Command1_Click()
MsgBox CStr(IsInteger(txtca(0)))
End Sub
Public Function IsInteger(valor As String) As Boolean
' Cint accepts Leading / Trailing spaces
' Cint accepts leading or Trailing Signs
' "-1", "1-", " 1- "
' "-0001 "
Dim I As Integer
Dim blnInt As Boolean
If InStr(1, valor, ".") > 0 Then
ElseIf InStr(1, valor, "+") > 0 Then ' No + ???
ElseIf InStr(1, valor, "-") > 0 Then ' No - ???
ElseIf Len(Trim$(valor)) <> Len(valor) Then ' No spaces ???
Else
On Error Resume Next
I = CInt(valor) ' Final Check
blnInt = (Err.Number = 0)
On Error GoTo 0
End If
IsInteger = blnInt
End Function