Subscribe:Posts Comments

You Are Here: Home � � Check String

Option Explicit

Private Function IsNumber(strg As String)

Dim nInt As String

'Check if string contains a number

If IsNumeric(strg) Then
nInt = Int(strg)

' Check if number is an integer
If strg = nInt Then

' Put your code here

MsgBox "It is an Integer number"

Else

' Put your code here

MsgBox "It is a NON Integer number"

End If
Else

' Put your code here

MsgBox "It is NOT a number"

End If

End Function



Private Sub Command1_Click()

IsNumber Text1.Text

End Sub
Tags:

0 comments

Leave a Reply