Sub rename()
With Application.ActiveSheet
basePath = Application.ActiveWorkbook.Path
i = 1
Do While (.Cells(i, 1) <> "")
strFileName = basePath & "\" & .Cells(i, 1) & ".pdf"
If Dir(strFileName, 16) <> Empty Then
Name strFileName As basePath & "\" & .Cells(i, 2) & ".pdf"
End If
i = i + 1
Loop
End With
End Sub
Excel VBA 对文件 重命名
最新推荐文章于 2024-08-16 18:55:57 发布