|
- Option Explicit
- Sub Fish()
- Dim fp$, fn$, Savename$
- Dim wb As Workbook
-
- fp = ThisWorkbook.Path & ""
- fn = Dir(fp & "*.xls*")
- Application.ScreenUpdating = False
- Do While fn <> ""
- If fn <> ThisWorkbook.Name Then
- Set wb = Workbooks.Open(fp & fn)
- wb.Sheets("报验单").Rows("7:7").RowHeight = 31
- wb.Sheets("报验单").Rows("21:21").RowHeight = 36
- wb.Sheets("报验单").Columns("G:G").ColumnWidth = 6
- wb.Sheets("报验单").Rows("38:38").RowHeight = 51
- Savename = Split(fn, ".")(0) & "-已完成." & Split(fn, ".")(1)
- wb.SaveAs fp & "完成的文件" & Savename
- wb.Close False
- End If
- fn = Dir
- Loop
- Application.ScreenUpdating = True
-
- MsgBox "已另存至“完成的文件”文件夹中,并改名。", vbInformation, "提示信息"
- End Sub
复制代码 |
|