View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
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,