ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   make new .xls file (https://www.excelbanter.com/excel-programming/288660-make-new-xls-file.html)

goss[_8_]

make new .xls file
 
Hi all.
Using xl xp pro

Would like to create a new empty .xls file
C:\windows\temp\data.xls

Have read through this ng quite a bit
Can't seem to find anything
All threads about saving current wb with save as
However control.xls has other data I don't want to send to end-users

just want to copy data from 3 sheets in control.xls to ....data.xls


---
Message posted from http://www.ExcelForum.com/


Ron de Bruin

make new .xls file
 
Hi goss

Would like to create a new empty .xls file


Sub test()
Dim NWB As Workbook
Set NWB = Workbooks.Add
NWB.SaveAs "C:\Data\data.xls"
NWB.Close False
End Sub


just want to copy data from 3 sheets in control.xls to ....data.xls


Use this macro with control.xls as the activeworkbook

Sub test2()
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Copy
Set wb = ActiveWorkbook
wb.SaveAs "C:\Data\data.xls"
wb.Close False
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"goss " wrote in message ...
Hi all.
Using xl xp pro

Would like to create a new empty .xls file
C:\windows\temp\data.xls

Have read through this ng quite a bit
Can't seem to find anything
All threads about saving current wb with save as
However control.xls has other data I don't want to send to end-users

just want to copy data from 3 sheets in control.xls to ....data.xls


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 06:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com