'1.用户可以任意选择文件夹进行遍历 '2.限定遍历时仅搜索EXCEL文件(你可以改变文件类型) '这个程序要先在“引用”下选择"microsoft scripting runtime"库文件 Dim ArryFile() As String Dim nFile As Integer Sub Filelist() Dim fso As New FileSystemObject Dim fd As Folder Dim strFilePath As String Dim FolderSe…
今天,有同事提出想批量修改文件名,规则比较简单,在第五位后加“-”即可, 上网没找到相关工具,就自己做了个excel,用宏代码修改. 代码如下: Private Sub CommandButton1_Click() Dim varFileList As Variant MsgBox "选择要重命名文件所在的文件夹,点击确定!" With Application.FileDialog(msoFileDialogFolderPicker) .AllowMultiSelect = F…