各位老师:我在E盘下有N个以数值命名的文件,我在vba中获取文件名,并想求获取到数值的最大值,没有成功,请指点!
Mypath = "E:"
n = 1
myfile = Dir(Mypath & "\*.*")
Do While myfile <> ""
s = Mid(myfile, 5, 8) '文件名中第五位开始,取得8位数
myfile = Dir
n = n + 1
Loop
a = Application.WorksheetFunction.Max(s)
MsgBox a
结果显示的始终是最后一个文件的数值,求教