Sub 另存為()
Dim cPath$, cFile$, sh As Worksheet, shp As Shape, Arr()
If MsgBox("點(diǎn)擊“確定”生成文件到桌面", vbYesNo) <> vbYes Then Exit Sub '生成文件
cPath = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\"
Application.DisplayAlerts = False
Application.ScreenUpdating = False
With ActiveWorkbook
For Each sh In .Worksheets
cFile = sh.Range("k1").Value
If cFile <> "" Then
sh.Copy
With ActiveWorkbook
For Each shp In .Sheets(1).Shapes
shp.Delete '刪除按鈕
Next
.Sheets(1).UsedRange.Value = .Sheets(1).UsedRange.Value
.SaveAs Filename:=cPath & cFile & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
.Close
End With
End If
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
.Close
End With
End Sub
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請
點(diǎn)擊舉報。