Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What's wrong in this Eqn? | Excel Worksheet Functions | |||
What is wrong with my UDF | Excel Discussion (Misc queries) | |||
Insert Calculated Field (wrong Qty*Price = wrong Amount) | Excel Discussion (Misc queries) | |||
Getting wrong value due to ref? | Excel Discussion (Misc queries) | |||
What am I doing wrong? | New Users to Excel |