Answers:
它不是内置功能。
但是,如果您运行此代码,它就可以完成任务。
Sub SaveSheets()
Dim strPath As String
Dim ws As Worksheet
Application.ScreenUpdating = False
strPath = ActiveWorkbook.Path & "\"
For Each ws In ThisWorkbook.Sheets
ws.Copy
'Use this line if you want to break any links:
BreakLinks Workbooks(Workbooks.Count)
Workbooks(Workbooks.Count).Close True, strPath & ws.Name & ".xlsx"
Next
Application.ScreenUpdating = True
End Sub
Sub BreakLinks(wb As Workbook)
Dim lnk As Variant
For Each lnk In wb.LinkSources(xlExcelLinks)
wb.BreakLink lnk, xlLinkTypeExcelLinks
Next
End Sub
要运行代码,请执行以下操作:
SaveSheets
Workbooks(Workbooks.Count).BreakLinks
在ws.Copy
... 后面插入来轻松地将它们替换为值
Workbooks(Workbooks.Count).BreakLink
-没有s
在最后
我试着彼得·艾伯特的解决方案,它并没有为我工作,所以我找到了一个解决方案这篇文章(“创先争优-保存工作表作为单独的文件”)的计算机怪胎的日记。
效果很好。您应该重命名包含点的图纸,以获取带有.xls
扩展名的正确命名的文件。
Sub CreateNewWBS()
Dim wbThis As Workbook
Dim wbNew As Workbook
Dim ws As Worksheet
Dim strFilename As String
Set wbThis = ThisWorkbook
For Each ws In wbThis.Worksheets
strFilename = wbThis.Path & "/" & ws.Name
ws.Copy
Set wbNew = ActiveWorkbook
wbNew.SaveAs strFilename
wbNew.Close
Next ws
End Sub
使用说明从Peter Albert的帖子或如何在MS Office中添加VBA来创建和运行此宏。