LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default userform addition

Actually it isn't an oddity. The plus sign was the original concatenation
operator. So if you + two strings, you get concatenation. Values in
textboxes are strings even if they are numeric in nature.

--
Regards,
Tom Ogilvy


"Leith Ross" wrote
in message ...

Hello Gary,

Its one of those VBA oddities. It's a good practice not to rely on the
system to decide what math function to perform on string data. Change
your code to this and it will work fine regardless of what you do.

N = Val(TextBox1.Value) + Val(TextBox2.Value)

N will equal 15

TextBox.Value doesn't return a numeric value. It simply returns what is
currrently diplayed by the TextBox.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:

http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=484631



 
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
Addition of Days Ricky Excel Discussion (Misc queries) 3 January 27th 09 09:13 AM
Addition? Frodo Excel Discussion (Misc queries) 3 July 22nd 06 01:15 PM
addition dali New Users to Excel 1 March 4th 06 06:40 PM
row addition Threshold Excel Worksheet Functions 3 March 17th 05 08:08 PM
Userform addition question Patrick Simonds Excel Programming 3 May 22nd 04 04:20 PM


All times are GMT +1. The time now is 03:26 PM.

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

About Us

"It's about Microsoft Excel"