就是不断的把自己代进去,越代越小,直到等于1,那就是1了。
您能提出这等 问题说明您的VBA水平有一定火候了,请看Function Fllst(Pth$)
Dim Fso As Object
Dim Fld, Fl
Set Fso = CreateObject("卜腊枣Scripting.FileSystemObject")
Set Fld = Fso.getfolder(Pth)
On Error Resume Next
For Each Fl In Fld.Files
[A65536].End(3)(2) = Fl.path
Next
For Each Fl In Fld.SubFolders
Fllst (Fl.path)
Next
End Function
Sub getList()
Dim Fso As Object
Set Fso = CreateObject("Scripting.FileSystemObject")
[A:A].ClearContents
Application.ScreenUpdating = False
Fllst (CreateObject("局岁Shell.Application").BrowseForFolder(0, "请选择目录型拆", 0, "").Self.path)
Application.ScreenUpdating = True
Set Fso = Nothing
End Sub
Sub test()n = 5
For i = 1 To n
sumtest = suntest + (-1) ^ i * i
Next i
MsgBox sumtest
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)