convert text to integer

J

jr

Why can't I use CInt on this line? I get a syntax error. Is there
no CInt function in Excel 2004?
I want the user to pick a string value in an array and then have the
value converted to an Int.
Dim i As Integer = CInt(texbox1.text)

thanks,
 
J

JE McGimpsey

jr said:
Why can't I use CInt on this line? I get a syntax error. Is there
no CInt function in Excel 2004?
I want the user to pick a string value in an array and then have the
value converted to an Int.
Dim i As Integer = CInt(texbox1.text)

You can't assign a value in a declaration line. Try something like

Dim i As Integer
i = CInt(texbox1.text)
 
Top