Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Exporting from worksheets into new workbooks

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Exporting from worksheets into new workbooks

Hi nir020

Use this example
http://www.rondebruin.nl/copy6.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"nir020" wrote in message ...
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/ move selected data from workbooks to seperate worksheets or workbooks Positive Excel Worksheet Functions 1 August 30th 07 04:54 PM
exporting data from Workbooks in Folder juergenkemeter Excel Programming 0 December 23rd 05 12:46 AM
Exporting the same Excel macro to 60 workbooks [email protected] Excel Programming 2 January 20th 05 08:39 PM
Exporting multiple worksheets as CSV Mike O[_3_] Excel Programming 0 February 25th 04 06:05 PM
Exporting multiple worksheets as CSV Joe Sheehan Excel Programming 3 February 24th 04 02:38 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"