Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
FYI Excel 2007: Saving a xlsm file with a hidden worksheet activated makes worksheet visible | Excel Programming | |||
Split a worksheet into multiple worksheets of the same Excel file | Excel Discussion (Misc queries) | |||
Split a worksheet into multiple worksheets of the same Excel file | Excel Programming | |||
Saving just 1 worksheet out of a workbook to a separate file | Excel Discussion (Misc queries) | |||
Saving worksheet in new file with date AND cell value as file name | Excel Discussion (Misc queries) |