标签:sub 文件 mys his 文件夹 sam save close 内容
一个工作簿中包括N个工作表,将各个工作表拆分成工作簿。
工作表数量不定,表内内容不限,拆分后保存于当前文件夹内。
Sub Sample()
Dim MySheetsCount As Long
For MySheetsCount = 1 To Sheets.Count
Sheets(MySheetsCount).Copy
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & Sheets(1).Name & ".xlsx"
ActiveWindow.Close
Next
End Sub
标签:sub 文件 mys his 文件夹 sam save close 内容
原文地址:https://www.cnblogs.com/officeplayer/p/11028948.html