Exporting from worksheets into new workbooks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have written the following code, which when run, I want to go through all
the sheets in my workbook and and copy and paste the data from these sheets
into new workbooks.

Unfortunatly the code below will cause the data from the same worksheet to
be copied into new workbooks,

Can anyone help

Sub sheetexport()

Dim sheet_var As Worksheet
For Each sheet_var In ActiveWorkbook.Worksheets

Cells.Copy
Workbooks.Add
Application.ScreenUpdating = False
Selection.PasteSpecial Paste:=xlPasteValues
Selection.PasteSpecial Paste:=xlPasteFormats

Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top