export file to excel

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top