我有这段代码将工作簿中的每个标签保存为新文件。
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ActiveWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
保存新文件后,我需要重命名"产品"在每种情况下,因为这是将文件导入另一个程序的要求。如果不单独打开每个新文件,这是否可行?