save worksheet to a folder
How can I save a worksheet from a workbook to another workbook and name it
date saved at using a vb code. And any additional sheet to be saved in the same workbook. My aim is to be able to save a stat sheet automatically once a week. -- Hoyos |
save worksheet to a folder
Sub SaveMyWorkbook()
Worksheets("Sheet1").Copy ActiveWorkbook.SaveAs Format(Date, "yyyy-mm-dd") & ".xls" End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Hoyos" wrote in message ... How can I save a worksheet from a workbook to another workbook and name it date saved at using a vb code. And any additional sheet to be saved in the same workbook. My aim is to be able to save a stat sheet automatically once a week. -- Hoyos |
save worksheet to a folder
Thanks Bob.
Will this save the worksheet copied to another folder? -- Hoyos "Bob Phillips" wrote: Sub SaveMyWorkbook() Worksheets("Sheet1").Copy ActiveWorkbook.SaveAs Format(Date, "yyyy-mm-dd") & ".xls" End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Hoyos" wrote in message ... How can I save a worksheet from a workbook to another workbook and name it date saved at using a vb code. And any additional sheet to be saved in the same workbook. My aim is to be able to save a stat sheet automatically once a week. -- Hoyos |
save worksheet to a folder
Add the folder's path in front of the Format statement. For example...
ActiveWorkbook.SaveAs "c:\temp\" & Format(Date, "yyyy-mm-dd") & ".xls" Rick "Hoyos" wrote in message ... Thanks Bob. Will this save the worksheet copied to another folder? -- Hoyos "Bob Phillips" wrote: Sub SaveMyWorkbook() Worksheets("Sheet1").Copy ActiveWorkbook.SaveAs Format(Date, "yyyy-mm-dd") & ".xls" End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Hoyos" wrote in message ... How can I save a worksheet from a workbook to another workbook and name it date saved at using a vb code. And any additional sheet to be saved in the same workbook. My aim is to be able to save a stat sheet automatically once a week. -- Hoyos |
save worksheet to a folder
No, if you want that, best to be specific
Sub SaveMyWorkbook() Worksheets("Sheet1").Copy ActiveWorkbook.SaveAs "C:\myFolder\mySubFolder\" & Format(Date, "yyyy-mm-dd") & ".xls" End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Hoyos" wrote in message ... Thanks Bob. Will this save the worksheet copied to another folder? -- Hoyos "Bob Phillips" wrote: Sub SaveMyWorkbook() Worksheets("Sheet1").Copy ActiveWorkbook.SaveAs Format(Date, "yyyy-mm-dd") & ".xls" End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Hoyos" wrote in message ... How can I save a worksheet from a workbook to another workbook and name it date saved at using a vb code. And any additional sheet to be saved in the same workbook. My aim is to be able to save a stat sheet automatically once a week. -- Hoyos |
save worksheet to a folder
Thanks Bob. that works well
-- Hoyos "Hoyos" wrote: How can I save a worksheet from a workbook to another workbook and name it date saved at using a vb code. And any additional sheet to be saved in the same workbook. My aim is to be able to save a stat sheet automatically once a week. -- Hoyos |
All times are GMT +1. The time now is 12:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com