Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mat Mat is offline
external usenet poster
 
Posts: 4
Default Save single worksheet?

I've got a workbook containing multiple sheets, one of
which is a Invoice. I want the user to be able to press a
button, and for it to save the Invoice sheet only. I hit
the problem on the saving part. I can get it to save the
whole workbook, but not the single sheet.

How could I do this in VBA?
Thanks,
Mat,

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

Try this Mat

Sub test()
Sheets("Invoice").Copy
ActiveWorkbook.SaveAs "c:\data\Invoice " & Format(Now, "dd-mm-yy h-mm-ss")
ActiveWorkbook.Close
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Mat" wrote in message ...
I've got a workbook containing multiple sheets, one of
which is a Invoice. I want the user to be able to press a
button, and for it to save the Invoice sheet only. I hit
the problem on the saving part. I can get it to save the
whole workbook, but not the single sheet.

How could I do this in VBA?
Thanks,
Mat,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Save single worksheet?

Mat,

You can only save a workbook, so you would need to move the worksheet to a
new workbook and then save that, something like

Worksheets("Sheet1").Copy
ActiveWorkbook.SaveAs Filename:= "myfile.xls"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mat" wrote in message
...
I've got a workbook containing multiple sheets, one of
which is a Invoice. I want the user to be able to press a
button, and for it to save the Invoice sheet only. I hit
the problem on the saving part. I can get it to save the
whole workbook, but not the single sheet.

How could I do this in VBA?
Thanks,
Mat,



  #4   Report Post  
Posted to microsoft.public.excel.programming
Mat Mat is offline
external usenet poster
 
Posts: 4
Default Save single worksheet?

Thanks to both of you, I appreciate it.

Works now :)
Ta.
Mat

-----Original Message-----
Try this Mat

Sub test()
Sheets("Invoice").Copy
ActiveWorkbook.SaveAs "c:\data\Invoice " & Format(Now,

"dd-mm-yy h-mm-ss")
ActiveWorkbook.Close
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Mat" wrote in message news:

...
I've got a workbook containing multiple sheets, one of
which is a Invoice. I want the user to be able to press

a
button, and for it to save the Invoice sheet only. I hit
the problem on the saving part. I can get it to save the
whole workbook, but not the single sheet.

How could I do this in VBA?
Thanks,
Mat,



.

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
Change Default Save As for Single worksheet Pammi J Excel Discussion (Misc queries) 1 February 18th 09 04:45 PM
save single excel worksheet out of workbook in excel 2007 rokbroscore Excel Discussion (Misc queries) 2 July 13th 07 09:43 PM
merging single worksheet files into a single workbook DDK Excel Discussion (Misc queries) 1 December 5th 06 05:25 PM
How do we Extract/Save a single worksheet out of a Mutlipage workb Tom Excel Discussion (Misc queries) 2 March 16th 06 02:58 PM
Save a single worksheet in Excel as a single file. Dakota New Users to Excel 4 February 22nd 06 04:46 PM


All times are GMT +1. The time now is 10:14 AM.

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"