copy a worksheet to another xls file

  • Thread starter Thread starter Jac
  • Start date Start date
J

Jac

I have made a macro using with a VB function which generates a new
worksheet. I want to copy the generated worksheet into a new xls-file which
I want to create by a dialog-save file. Can anyone give me some simple
example code?

Jac
 
Jac,

Try something like the following:

Dim FName As Variant
ActiveSheet.Copy
FName = Application.GetSaveAsFilename(filefilter:="Excel
files (*.xls),*.xls")
If FName <> False Then
ActiveWorkbook.SaveAs FName
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Thanks

Chip Pearson said:
Jac,

Try something like the following:

Dim FName As Variant
ActiveSheet.Copy
FName = Application.GetSaveAsFilename(filefilter:="Excel
files (*.xls),*.xls")
If FName <> False Then
ActiveWorkbook.SaveAs FName
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top