how to add numbers such as 1+1 to get 2 not 11

okay i have beat my head against the wall for ever trying to get the right code to add two numbers to get there sum as in 1+1=2 not 11 can you guys help :)
chuk1Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Belgarion_ausConnect With a Mentor Commented:
Some Code......

Dim x as integer

x = 1 + 1


if you working with text:

x = val("1") + val("1")

both examples will return 2

0
 
ChasDevlinCommented:
I imagine you are working with strings or variants.

text1.value = cstr(cint("1") + cint("1"))


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.