Click to See Complete Forum and Search --> : a multiplication question
merhaba
Feb 9th, 2006, 11:11 AM
Hi,
Hope you can help me.. I have those numbers below..I want to craete a small
program that can give me the multiplication result of all these numbers..I dont want to use a calculator to calculate...
I want to paste these numbers to a textbox or a listbox and display the results on a label..Or is it possible to do this kind of calculation using EXCEL
Which function should I use?
*1,65
*1,35
*1,40
*1,35
*1,35
*1,40
*1,65
*1,35
*1,65
*1,25
Thanks...
zaza
Feb 9th, 2006, 12:31 PM
If you're using Excel, then the Product function will return what you are after.
I assume those asterisks are not really supposed to be there, and that the commas are the continental form of decimal points.
zaza
merhaba
Feb 9th, 2006, 12:42 PM
yes you are right...I paste all those nums to a excel page bu it doesn't calculate nor
does the sum..I removed all those asterisks.....I noticed that all of the numbers are aligned left not to right..thats the reason for excel not to calculate...but I could not make them align right...although they are not text ???
zaza
Feb 9th, 2006, 12:44 PM
They may be entered as text...select them all, right click and choose Format Cells, then change the format to number.
zaza
merhaba
Feb 9th, 2006, 12:56 PM
Yes I tried it and other options ,too
but it did not work :sick:
zaza
Feb 9th, 2006, 01:29 PM
Is there a confusion with using the comma as a decimal point? I have found this to be troublesome in the past. Can you do any numerical operations on them? Does it recognise them as numbers?
zaza
merhaba
Feb 9th, 2006, 02:30 PM
Thanks Zaza, :wave:
I got the solution ..and it works perfect.. I paste and get the result :p
Private Sub Command1_Click()
Dim texxt As String
Dim asd() As String
Dim iTotal As Double
texxt = Text1.Text
asd = Split(texxt, vbCrLf)
iTotal = 1
For i = LBound(asd) To UBound(asd)
If LenB(asd(i)) <> 0 Then iTotal = iTotal * asd(i)
Next i
MsgBox iTotal
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.