+ Reply to Thread
Results 1 to 3 of 3

Q: save a sheet to a file

  1. #1
    JIM.H.
    Guest

    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. #2
    Registered User
    Join Date
    02-04-2004
    Posts
    23
    ActiveSheet.Copy
    ActiveWorkbook.SaveAs Filename:= "C:\somefilename.xls"

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

  3. #3
    Dave Peterson
    Guest

    Re: 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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1