|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub rnm()
- Dim Fso As Object, Folder As Object, arr$(), m&, i&, sh As Worksheet
- Dim WS As Worksheet
- Dim WB As Workbook
- Dim Num As Long
- Dim j As Integer
- Set Fso = CreateObject("Scripting.FileSystemObject")
- Set Folder = Fso.GetFolder(ThisWorkbook.Path)
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
-
- For Each fd In Folder.subfolders
- For Each fdd In fd.subfolders
- pth = fdd & "\1.xls"
- If Dir(pth) <> "" Then
- With Workbooks.Open(pth)
- For Each sht In .Sheets
- sht.Name = "NewName" & sht.Index
- Next
- .Save
- .Close False
- End With
- End If
- Next fdd
- Next
- Set Folder = Nothing
- Set Fso = Nothing
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|