Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
JIM.H.
 
Posts: n/a
Default Q: save a sheet to a file

I use ActiveWorkbook.SaveAs destFile in a macro to save current workbook to a
n excel file, how can I save only a specific sheet in current workbook to a
file?
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default Q: save a sheet to a file

Manually, you could copy that sheet to a new workbook and save that new
workbook.

Dim Wks as worksheet
dim destFile as string

destfile = "c:\temp\myfile.xls"
set wks = activeworkbook.worksheets("Sheet99")
wks.copy 'creates a new workbook

activeworkbook.saveas destfile
activeworkbook.close savechanges:=false


JIM.H. wrote:

I use ActiveWorkbook.SaveAs destFile in a macro to save current workbook to a
n excel file, how can I save only a specific sheet in current workbook to a
file?


--

Dave Peterson
  #3   Report Post  
i-Zapp
 
Posts: n/a
Default Q: save a sheet to a file


ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:= "C:\somefilename.xls"

try using the record macro functionality. works good for stuff like
this.


--
i-Zapp
------------------------------------------------------------------------
i-Zapp's Profile: http://www.excelforum.com/member.php...fo&userid=5768
View this thread: http://www.excelforum.com/showthread...hreadid=479106

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
Disable Dialogue Box To Save & Replace File Dolphinv4 Excel Discussion (Misc queries) 2 October 24th 05 05:42 AM
Macro to save a file as ynissel Excel Discussion (Misc queries) 4 May 26th 05 02:48 PM
User cannot save excel file in workbook Justin@Martin Excel Worksheet Functions 0 May 16th 05 01:52 PM
Is it possible to recover a deleted sheet after saving the file? RoseM Excel Discussion (Misc queries) 1 January 25th 05 03:04 PM
Hyperlink to specific sheet in Excel Web File jd17 Links and Linking in Excel 0 December 8th 04 09:03 PM


All times are GMT +1. The time now is 07:02 PM.

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"