Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default saving single worksheet

Hello,

I want to save one worksheet of a workbook as a separate xls-file.
I use: Worksheets("test").SaveAs "test1.xls".

According to the help this should do the job.
But everytime the whole workbook is saved, including all other worksheets.
How to solve this?

Thanks for your answer.

Ed van Wijngaarden


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default saving single worksheet

Hi E.J.

' copy the sheet to a new workbook
Worksheets("test").Copy
' save the worbook with only the sheet test
ActiveWorkbook.SaveAs "C:\test1.xls"


--
Regards Ron de Bruin
http://www.rondebruin.nl


"E.J. van Wijngaarden" wrote in message ...
Hello,

I want to save one worksheet of a workbook as a separate xls-file.
I use: Worksheets("test").SaveAs "test1.xls".

According to the help this should do the job.
But everytime the whole workbook is saved, including all other worksheets.
How to solve this?

Thanks for your answer.

Ed van Wijngaarden




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default saving single worksheet

Hi,

This will do it.


Sub SaveTestSheetSeparately()
Worksheets("test").Copy
ActiveWorkbook.SaveAs "test1.xls"
End Sub

Paul

"E.J. van Wijngaarden" wrote in message
...
Hello,

I want to save one worksheet of a workbook as a separate xls-file.
I use: Worksheets("test").SaveAs "test1.xls".

According to the help this should do the job.
But everytime the whole workbook is saved, including all other worksheets.
How to solve this?

Thanks for your answer.

Ed van Wijngaarden




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default saving single worksheet

Thanks for both answers.

I changed the code to:

Sub SaveTestSheetSeparately()
Application.ScreenUpdating = False
Worksheets("test").Copy
ActiveWorkbook.SaveAs "test1.xls"
ActiveWorkbook.Close
Application.ScreenUpdating = True
End Sub

Now it does exactly what I want.

Ed


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
merging single worksheet files into a single workbook DDK Excel Discussion (Misc queries) 1 December 5th 06 05:25 PM
Save a single worksheet in Excel as a single file. Dakota New Users to Excel 4 February 22nd 06 04:46 PM
Copy from different workbook's worksheet into a single worksheet... [email protected] Excel Discussion (Misc queries) 1 October 27th 05 07:27 PM
Converting multiple worksheet to a single page worksheet [email protected] Excel Discussion (Misc queries) 0 July 4th 05 06:26 PM
Saving a single cell Paul Schu Excel Programming 1 August 6th 03 05:33 PM


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