Need code to sum a series
Do not really need a VBA UDF, this should work ona worksheet.
{=SUM(1/FACT(ROW(1:150)))}
or in VBA if thats what you really need
Function test(n As Integer)
Dim s As String
s = "=SUM(1/FACT(ROW(1:" + Trim(Str(n)) + ")))"
test = Evaluate(s)
End Function
|