Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change Default Save As for Single worksheet | Excel Discussion (Misc queries) | |||
save single excel worksheet out of workbook in excel 2007 | Excel Discussion (Misc queries) | |||
merging single worksheet files into a single workbook | Excel Discussion (Misc queries) | |||
How do we Extract/Save a single worksheet out of a Mutlipage workb | Excel Discussion (Misc queries) | |||
Save a single worksheet in Excel as a single file. | New Users to Excel |