求助 一段改文件名的代码 错在哪 ?谢谢!
Sub aaa()Dim bb As String
Dim cc As String
Dim d As String
bb = Dir("C:\Documents and Settings\Administrator\桌面\需要改名" & "\*.*", vbNormal)
cc = "C:\Documents and Settings\Administrator\桌面\改名后的文件"
a = 0
Do While bb <> "" '
a = a + 1
d = InStrRev(bb, ".")
If Mid(bb, d, 4) = ".mp4" Then
Name bb As cc & "\" & a & ".mp4" '提示:文件没找到。错在哪 ?
End If
bb = Dir
Loop
End Sub
说明 bb 不是空的,目标文件夹中一定有*.mp4 文件苦干
[此贴子已经被作者于2015-12-25 02:20编辑过]