View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Save one worksheet from a workbook to a new .csv file

Hi Chuck

Try this for the activesheet

Sub ActiveSheet_CSV_File()
Dim wb As Workbook
Dim strdate As String
Dim Fname As String
strdate = Format(Now, "dd-mmm-yy h-mm-ss")
Fname = "C:\Part of " & ThisWorkbook.Name _
& " " & strdate & ".csv"
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs Fname, FileFormat:=xlCSV
.Close False
End With
Application.ScreenUpdating = True
End Sub




--
Regards Ron de Bruin
http://www.rondebruin.nl



"Chuck M" wrote in message ...
Hi,

In code, how can I save one specific worksheet from a workbook with many
worksheets to a new .csv file. I've looked at the SaveAs Method in Help but I
don't see the answer there. Any help would be appreciated.
--
Thanks.
Chuck M.