Id like to know if someone have a code for visual basic/ excel to calculate the the product of a sequence of numbers in VBA, i'm using windowns 7/vista.The definition of the product of n numbers is https://es.wikipedia.org/wiki/Productorio
What i already tried:
Function mo( j, n)
Dim x As Double, j As Double
x = 10 -1/n
For j = 1 To n
s = Application.WorksheetFunction.Product(x)
Next
mo = t
End Function
I used Application.WorksheetFunction.Product(x) from excel and nothing happened. It didn't work.
x = 10 -1/n is the number generating function for j from 0 to n
i want the Product of all the numbers that are generated from that equation.
for example, from 1 to 10 the resulting numbers would be:9
9,5 9,666666667 9,75 9,8 9,833333333 9,857142857 9,875 9,888888889 9,9
P= 9,5* 9,666666667* 9,75* 9,8 * 9,833333333 *9,857142857 9,875* 9,888888889* 9,9 = 7400228969
In general, i want Product function in VBA of all the numbers that are generated from that equation (x = 10 -1/n) in order to put in a simpler way inside another more large complicated (mind-blowing) equation .
Expand|Select|Wrap|Line Numbers
- Function mo( j, n)
- Dim x As Double, j As Double
- x = 10 -1/n
- For j = 1 To n
- s = Application.WorksheetFunction.Product(x)
- Next
- mo = t
- End Function
Thanks in advance