textbox.value doesn't create a number?

L

Larry Levinson

Obviously, I am mistaken, but I thought if i told a userform wth text
boxes on it to treat the inputs as numbers, they would become numbers.

I tried to add two numbers that were in the text boxes, but instead of
a + b, I got the string, ab ... any suggestions?


Larry Levinson
Talking up to the vocal ...
LLevinson*Bloomberg.net
(remove the star etc ....)
 
B

Bob Phillips

Larry,

Try something like

MsgBox CLng(TextBox1.Text) + CLng(TextBox2.Text)
 
L

Larry Levinson

or, this:

bn_first = Sheets("Japan").Range("c10000").Value +
Sheets("Japan").Range("e10000").Value

once I stuff the data on the sheet, that is.
Bob Phillips said:
Larry,

Try something like

MsgBox CLng(TextBox1.Text) + CLng(TextBox2.Text)

Larry Levinson
Talking up to the vocal ...
LLevinson*Bloomberg.net
(remove the star etc ....)
 

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