窗体中放入Text控件和命令按钮.取text中的数字作为N代码如下Private Function F(n As Long) As LongIf n > 2 ThenF = F(n - 1) + F(n - 2)ElseF = 1End IfEnd FunctionPrivate Sub Command1_Click()ClsDim I As LongI = Val(Text1.Text)Print "第" & I & "项:" & F(i) End Sub