How can I change this code to get the product of the numbers between 1 and a variable n. Here's the code, and I can just get the n's square.
Function product(ByVal n As Double, ByRef i As Double)
Dim a As Double
For i = 1 To n
a = n * i
Next
Return a
End Function
Thanks.