![]() |
What do i wrong here
Alvin
Everything in a textbox is text, not numeric. The minus sign in the first example coerces the text into numbers and you get the right answer. The plus sign, on the other hand, is a way to concatenate text strings (a deprecated way that no should ever use), so it doesn't do the coercion that you need. To get it to work both ways, explicitly convert the text to numeric flydiff = Val(TextBox7.Text) + Val(TextBox10.Text) The .Text and .Value properties are the same for textboxes. -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "Alvin Hansen" wrote in message ... This one is working flydiff = (TextBox7.Value - TextBox10.Value) TextBox11.Value = flydiff This one will not work flydiff = (TextBox7.Value + TextBox10.Value) TextBox11.Value = flydiff Alvin |
All times are GMT +1. The time now is 10:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com