![]() |
| ||
| Sum of the numbers of one textbox How can I get the sum of the numbers of only one textbox? For example text1.text= 1367 How to get the sum of this 4 digit number? I appreciate your assistance in advance. Lida |
| ||
| Quote:
Try this: text1.text = 1367 text2.text = sum(text1.text) |
| ||
| if you want only 4 digit will type in text box then adjust the properties of text box. max length = 4 |
| ||
| To all... I'm not sure if the solution is so easy as you write... VB(at least my 6 one) does not have the sum function... its necessary to write it at first. It could looks like this: Public Function SUM(sNumber as String) As Integer :) |
| ||
| Quote:
|
| ||
| Quote:
|
| ||
| Lida_Pink, Lets make sure of our definitions first... The sum of numbers is, those numbers being added together, while the product of numbers is, those numbers being multiplied together. So if you want the sum of numbers in a string then celt.max's code does work... Option Explicit However, if you are wanting the product of the numbers, then yes a different solution is needed. So, are you wanting the product of these numbers? Good Luck |
| ||
| Try the following to get the sum of an integer - Private Sub Command1_Click() |
| ||
| I need the sum of the numbers. And thank you very much. Your answer is correct. Cheers, Lids |
| All times are GMT -4. The time now is 11:09 am. |
Forum system based on vBulletin Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
©2003 - 2010 DaniWeb® LLC