• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

how to copy and save sheets in another new workbook.

Nitesh Khot

Member
Hi.....

I my excel workbook....i have total 106 sheets...I want to copy each individual sheet in new workbook with same sheet name to workbook name..........is this possible to copy all sheets individual at one time using VBA.


Thanks
Nitesh khot
 
This will do the same....

Code:
Sub Sheet_as_Wb()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
  ws.Copy
  ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & ws.Name & ".xlsx", FileFormat:=xlOpenXMLWorkbook
  ActiveWindow.Close False
Next
Application.ScreenUpdating = True
End Sub
 
where this code put.....Thisworkbook or sheet.

I have entered code in thisworkbook,,but while executing getting error RUNTIME ERROR 13 TYPE MISMATCH
 
Back
Top