Re: a string to an integer
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Wed, 04 Nov 2009 10:54:35 -0600
Don't use String and Int as variable names.
String is a VBA function and data type.
Int is a VBA function.
Dim myString(1 To 3) As String
Dim myInt As Long
myString(3) = "543"
myInt = CInt(myString(3))
Personally, I wouldn't use "as integer" or cInt(). I'd use "As long" and
clng().
Philosophaie wrote:
I have a string:
string(3) = "543"
I try to change it to an integer:
int = cint(string(3))
It gives me a 'Type Mismatch' Error.
Maybe there may be spaces before of after the numbers but does that matter?
How do I change from a string to an integer?
--
Dave Peterson
.
- References:
- a string to an integer
- From: Philosophaie
- a string to an integer
- Prev by Date: page break automatic macro
- Next by Date: RE: Excel Userform??
- Previous by thread: RE: a string to an integer
- Next by thread: RE: a string to an integer
- Index(es):
Relevant Pages
|