Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong in this Eqn? Raz Excel Worksheet Functions 1 January 12th 10 07:27 PM
What is wrong with my UDF jlclyde Excel Discussion (Misc queries) 4 October 24th 08 03:06 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
Getting wrong value due to ref? jesmin Excel Discussion (Misc queries) 2 March 16th 06 02:12 AM
What am I doing wrong? Jeff New Users to Excel 4 March 6th 05 03:05 AM


All times are GMT +1. The time now is 09:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"