Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Save One sheet

Manually:
-Right click on the sheet tab. Select "Move or copy..."
-Under "To book" select "(new book)". Check "Create a copy". Click OK
-Save the new book with whatever name you choose.

Via code:
ThisWorkbook.Sheets("MySheet").Copy
(If you use this method without specifying a Before or After argument, the
sheet will be copied to a new 1-sheet workbook. Now you have to find that
new workbook in order to save it. I'm assuming there will only be one "new"
book at this point and that your other open workbooks names don't start with
"Book" - a lot of assumptions.)
For Each wkb In Workbooks
If Left(wkb.Name, 4) = "Book" Then
wkb.SaveAs "MyNewBook.xls"
Exit Sub
End If
Next wkb

Alternatively, use Workbooks.Add 1st to create a new workbook (provides a
handle for the new book from the start) and then copy the sheet into it:

Set wkb = Workbooks.Add
ThisWorkbook.Sheets("MySheet").Copy Befo=wkb.Sheets(1)

Application.DisplayAlerts = False
For i = wkb.Sheets.Count To 2 Step -1
' Delete all but the 1st sheet
wkb.Sheets(i).Delete
Next i
Application.DisplayAlerts = True

wkb.SaveAs "MyNewBook.xls"

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"Spencer Hutton" wrote in message
...
is it possible to save just one sheet of a workbook in it's own new
workbook?
i have a workbook with 3 sheets in it. how can i copy sheet1 to a new
workbook, and save it under the filename "savedbook". TIA.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Save One sheet

You don't need to do all of that work to "find" it. It's the active workbook
at this point, as Chip Pearson points out in his reply.


On Fri, 18 Feb 2005 13:40:25 -0600, "George Nicholson"
wrote:

(If you use this method without specifying a Before or After argument, the
sheet will be copied to a new 1-sheet workbook. Now you have to find that
new workbook in order to save it.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Save One sheet

Sorry Myrna, I don't like making assumptions like that, especially since it
isn't (to my knowledge) a documented "feature" of that method and I try to
avoid code that depends on something maintaining its "activeness".

I guess I'm just not that trusting :-)

--
George Nicholson

Remove 'Junk' from return address.


"Myrna Larson" wrote in message
...
You don't need to do all of that work to "find" it. It's the active
workbook
at this point, as Chip Pearson points out in his reply.


On Fri, 18 Feb 2005 13:40:25 -0600, "George Nicholson"

wrote:

(If you use this method without specifying a Before or After argument, the
sheet will be copied to a new 1-sheet workbook. Now you have to find that
new workbook in order to save it.




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
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
How to save only row changes to a new sheet J Sears Excel Discussion (Misc queries) 1 September 22nd 06 07:50 PM
save as w/sheet TUNGANA KURMA RAJU Excel Discussion (Misc queries) 4 September 16th 06 08:05 PM
Save sheet? Heine Excel Worksheet Functions 7 March 9th 05 10:55 AM
Save sheet as .txt Steph[_3_] Excel Programming 3 January 7th 05 03:07 PM


All times are GMT +1. The time now is 09:55 PM.

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"