Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.setup
G
 
Posts: n/a
Default Convert excel worksheets into new workbooks (new files)

I have an excel file that contains 80 worksheets. I want to automatically
convert each worksheet into own new excel file. How can I do that without
copying and pasting?
  #2   Report Post  
Posted to microsoft.public.excel.setup
Dave Peterson
 
Posts: n/a
Default Convert excel worksheets into new workbooks (new files)

Maybe some sort of macro:

Option Explicit
Sub testme()

Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Copy 'to a new workbook
With ActiveSheet
.Parent.SaveAs Filename:="C:\temp\" & .Name, _
FileFormat:=xlWorkbookNormal
.Parent.Close savechanges:=False
End With
Next wks

End Sub

Make sure C:\temp\ already exists (or change the code to point at an existing
folder)

G wrote:

I have an excel file that contains 80 worksheets. I want to automatically
convert each worksheet into own new excel file. How can I do that without
copying and pasting?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.setup
G
 
Posts: n/a
Default Convert excel worksheets into new workbooks (new files)

Thanks Dave!! I appreciate your quick response! I tested the script and it
works!!

"Dave Peterson" wrote:

Maybe some sort of macro:

Option Explicit
Sub testme()

Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Copy 'to a new workbook
With ActiveSheet
.Parent.SaveAs Filename:="C:\temp\" & .Name, _
FileFormat:=xlWorkbookNormal
.Parent.Close savechanges:=False
End With
Next wks

End Sub

Make sure C:\temp\ already exists (or change the code to point at an existing
folder)

G wrote:

I have an excel file that contains 80 worksheets. I want to automatically
convert each worksheet into own new excel file. How can I do that without
copying and pasting?


--

Dave Peterson

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
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
How do I View & print or convert to PDF xls files without excel. GLA Excel Discussion (Misc queries) 1 April 12th 05 12:59 PM
How do I convert PDF files to Excel? Kusko Excel Discussion (Misc queries) 2 March 11th 05 05:40 PM
how i convert excel files with images to access mike Excel Discussion (Misc queries) 1 March 7th 05 05:51 PM
sharing/using/saving Excel 2002 files in Excel 2003 maze2009 Excel Discussion (Misc queries) 0 January 20th 05 07:27 PM


All times are GMT +1. The time now is 05:30 AM.

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"