Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default how to export worksheets into seperate files

Hi,

I get a sent a workbook that has around 100 worksheets in it.
is it possible to export all of these worksheets out to new files with
the name of each new file to be that of the worksheet?

Pete.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default how to export worksheets into seperate files

With no validation...

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim NewWks As Worksheet

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



PeterRad wrote:

Hi,

I get a sent a workbook that has around 100 worksheets in it.
is it possible to export all of these worksheets out to new files with
the name of each new file to be that of the worksheet?

Pete.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default how to export worksheets into seperate files

Thank you Very Much
that works great.

Pete.


Dave Peterson wrote:

With no validation...

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim NewWks As Worksheet

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



PeterRad wrote:

Hi,

I get a sent a workbook that has around 100 worksheets in it.
is it possible to export all of these worksheets out to new files with
the name of each new file to be that of the worksheet?

Pete.


--

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
Totals from Seperate Worksheets to One Consolidated Sheet RudeRam Excel Discussion (Misc queries) 6 May 25th 06 03:07 AM
Combine worksheets from different excel files into one excel file dbguy11 Excel Discussion (Misc queries) 2 February 27th 06 03:06 PM
combine multiple worksheets & files into 1 Barb Excel Worksheet Functions 3 October 7th 05 11:43 PM
Excel 2000 worksheets save incorrectly as notepad files. Capdu Excel Discussion (Misc queries) 2 April 2nd 05 03:47 PM
How do I link 2 worksheets in different files? mocha joe Excel Worksheet Functions 2 March 31st 05 07:23 AM


All times are GMT +1. The time now is 11:21 AM.

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

About Us

"It's about Microsoft Excel"