n=val(text1.text)sum=0for i = 1 to n sum=sum+inext i 你在文本框1里面输入n的值,然后执行上述代码 就可以了 sum 就是最终结果
Private Sub Form_click()Dim n As Double, s As Doublen = Val(InputBox("输入一个数"))s = 1For i = 1 To n s = s * iNextMsgBox sEnd Sub