How to export Excel worksheets into new workbooks

前端 未结 2 1057
难免孤独
难免孤独 2021-01-15 02:24

I have a bunch of Excel workbooks that contain multiple worksheets. I want to loop through each workbook and export each worksheet into it\'s own new workbook. I want one wo

相关标签:
2条回答
  • 2021-01-15 02:54

    Within Excel this would be accomplished by copying the worksheet to a new workbook, not by creating a new workbook then adding the worksheet to it. This is achieved by using Worksheet.Copy without specifying where in the workbook you want to place the copied worksheet.

    More reading: http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.worksheet.copy(VS.80).aspx

    0 讨论(0)
  • 2021-01-15 02:57

    Doh!

    worksheet.SaveAs(Filename:=filePath)

    0 讨论(0)
提交回复
热议问题