![]() |
copy a worksheet to another xls file
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 |
copy a worksheet to another xls file
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 "Jac" wrote in message .. . 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 |
copy a worksheet to another xls file
Thanks
"Chip Pearson" schreef in bericht ... 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 "Jac" wrote in message .. . 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 |
All times are GMT +1. The time now is 03:38 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com