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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top