|
Sub 孝感应1到顶层另存无格式表()
Application.Calculation = xlCalculationManual '手动重算
On Error Resume Next
VBA.MkDir (Sheets("输入").Range("A13").Value & "\" & Sheets("顶层批复单").Range("b5").Value) '新建文件夹
Dim sh
sh = Array("顶层批复单", "填石", "自检沉降", "自检水准表第5遍", "抽检沉降", "抽检水准表第5遍")
On Error GoTo line
Worksheets(Array("顶层批复单", "填石", "自检沉降", "自检水准表第5遍", "抽检沉降", "抽检水准表第5遍")).Copy
For Each sh In ActiveWorkbook.Sheets
sh.UsedRange = sh.UsedRange.Value
Next
Worksheets("顶层批复单").Range("a25:c555,d1:aaa555").Delete
Worksheets("填石").Range("a31:h555,i1:aaa555").Delete
Worksheets("自检沉降").Range("a29:g555,h1:aaa555").Delete
Worksheets("自检水准表第5遍").Range("a30:g555,h1:aaa555").Delete
Worksheets("抽检沉降").Range("a29:g555,h1:aaa555").Delete
Worksheets("抽检水准表第5遍").Range("a30:g555,h1:aaa555").Delete
Call 删除控件图标插件
Sheets("自检沉降").Cells.Interior.ColorIndex = xlNone '清除表格所有背景色
Sheets("监理沉降").Cells.Interior.ColorIndex = xlNone '清除表格所有背景色
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & Sheets("顶层批复单").Range("b5").Value & "\" & Sheets("顶层批复单").Range("b6").Value & ".xls"
ActiveWorkbook.Close SaveChanges:=True
Exit Sub
line:
ActiveWorkbook.Close False
'Application.Calculation = xlCalculationAutomatic '自动重算
End Sub
|
|