export file to excel

  • Thread starter Thread starter owl527
  • Start date Start date
O

owl527

hi,
How do I export a range of data from one excel file, to a new exce
file with a specific file name? is it possible? or I can only expor
data to a text file? pls let me know. Thanks.
 
Hi, Owl,

Could you use the following:

Sub SaveSheetToNewWorkbook()
ThisWorkbook.Worksheets(1).Copy 'copies it to a new workbook
'the new workbook is now active
ActiveWorkbook.SaveAs "Saved Copy"
End Sub

This will save worksheet(1) to a new workbook called "Saved Copy".xls

Hope this helps

Pete
 
Back
Top