String to Integer

groupy

Registered User.
Local time
Today, 08:43
Joined
Dec 17, 2001
Messages
33
Hi,

I have a problem:

I want a string in a integer variable. When the string isn't a string, then must a msgbox be displayed.

Example:

Dim str As String
Dim int As Integer

If (str "is not integer") Then
MsgBox (Str & "is not a integer")
Else
int = str
End if

So I need a method for "is not integer"

Thanks a lot.
 
Code:
If IsNumeric(MyValue) = True Then
    intValue = CInt(MyValue)
Else
    MsgBox "Not an integer value"
End If
 
Thanks a lot.
 

Users who are viewing this thread

Back
Top Bottom