使用VBA复制若干个工作表,并另存到新的工作簿

代码如下:

Sub MoveSheets()

'在下面Array中列出所有需要复制的工作表的名称

Worksheets(Array("工作表1", "工作表11", "工作表22", "工作表32")).Copy

Set wbNew = ActiveWorkbook

With wbNew

    ActiveWorkbook.SaveAs Filename:="D:\folder_for_holding_saved_workbook" & "\name_of_saved_workbook.xlsx"

    .Close

End With

End Sub

 

    原文作者:CodingIsFun
    原文地址: https://blog.csdn.net/CodingIsFun/article/details/86537158
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞