ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calculate textboxvalues (https://www.excelbanter.com/excel-programming/335813-calculate-textboxvalues.html)

Peterke

calculate textboxvalues
 
Hi,

I'm trying to calculate 3 textboxevalues into one, but they don't add up as
the should.

UserForm1.TextBox5.Value = UserForm1.TextBox2.Value +
UserForm1.TextBox3.Value + UserForm1.TextBox4.Value

Why doesn't this work? Or does anyone knows a better way?

greetings



Tom Ogilvy

calculate textboxvalues
 
UserForm1.TextBox5.Value = Val(UserForm1.TextBox2.Value) + _
val(UserForm1.TextBox3.Value) + Val(UserForm1.TextBox4.Value)

the plus sign can be used for concatenation when used with strings and
values stored in textboxes are strings.

--
Regards,
Tom Ogilvy



"Peterke" wrote in message
...
Hi,

I'm trying to calculate 3 textboxevalues into one, but they don't add up

as
the should.

UserForm1.TextBox5.Value = UserForm1.TextBox2.Value +
UserForm1.TextBox3.Value + UserForm1.TextBox4.Value

Why doesn't this work? Or does anyone knows a better way?

greetings






All times are GMT +1. The time now is 01:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com