LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Split file, saving each tab/worksheet to a new workbook, w/tab asworkbook name?

I had a light-bulb moment this morning to resolve a months-long
problem ... can Excel via a script split up a file by saving each
worksheet to a separate workbook and taking each new workbook's name
from the sheet's original tab name?

I've found a couple of somewhat similar requets he
http://www.ozgrid.com/forum/showthread.php?t=14120, and he
http://groups.google.ca/group/micros...17ee2c1e6a95e2,
where the first one gives me an easier-looking script that seems
potentially more modifiable -- at least, to my less knowledgeable eyes
-- to what needs to be done <g:

--------------------------------------------
Sub Movesheets()
' Macro by WillR
' www.ozgrid.com

Dim oldBook As Workbook
Dim newBook As Workbook


Set oldBook = ActiveWorkbook
Set newBook = Workbooks.Add
newBook.Activate
oldBook. Sheets("Sheet2").Copy after:=newBook.Sheets("Sheet2")
ActiveSheet. Name = "NewSheet"
ActiveWorkbook. SaveAs FileName:=Format( Date, "MMMMYY") &
"Report.xls"
--------------------------------------------

Of course, the difference is that this one saves only sheet 2 to a new
workbook and gives it a specific name where I need all the worksheets
to be saved to new, individual workbooks and to have them named by
their sheet name.

Thanks! :oD
 
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
FYI Excel 2007: Saving a xlsm file with a hidden worksheet activated makes worksheet visible David G.[_3_] Excel Programming 0 August 3rd 09 07:16 PM
Split a worksheet into multiple worksheets of the same Excel file shree Excel Discussion (Misc queries) 1 November 4th 08 08:24 PM
Split a worksheet into multiple worksheets of the same Excel file shree Excel Programming 1 November 4th 08 08:24 PM
Saving just 1 worksheet out of a workbook to a separate file Rich D Excel Discussion (Misc queries) 1 January 23rd 08 02:31 AM
Saving worksheet in new file with date AND cell value as file name michaelberrier Excel Discussion (Misc queries) 4 May 26th 06 08:05 PM


All times are GMT +1. The time now is 07:50 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"