View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default a string to an integer


Spaces do matter.

Try

int = cint(trim(string(3))

"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?