ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Open Close workbooks (https://www.excelbanter.com/excel-discussion-misc-queries/42675-open-close-workbooks.html)

bbc1

Open Close workbooks
 
HI I have a workbook that user's use to input changed data each day into
severval different worksheets, once data is entered they have to save it as
filename(date) what I need is a macro that will close the saved workbook and
re-open the original.
eg saved worksheet is tallysheet28-8-05 original workbook tallysheet

Ron de Bruin

Hi bbc1

Look in the VBA for SaveCopyAs
Your origenal workbook stay open and a copy will be saved with the name you want

Dim wb As Workbook
Set wb = ActiveWorkbook
wb.SaveCopyAs "C:\" & wb.Name & " " & Format(Now, "dd-mm-yy h-mm-ss") & ".xls"


--
Regards Ron de Bruin
http://www.rondebruin.nl


"bbc1" wrote in message ...
HI I have a workbook that user's use to input changed data each day into
severval different worksheets, once data is entered they have to save it as
filename(date) what I need is a macro that will close the saved workbook and
re-open the original.
eg saved worksheet is tallysheet28-8-05 original workbook tallysheet




bbc1

Thankyou that works great.

"Ron de Bruin" wrote:

Hi bbc1

Look in the VBA for SaveCopyAs
Your origenal workbook stay open and a copy will be saved with the name you want

Dim wb As Workbook
Set wb = ActiveWorkbook
wb.SaveCopyAs "C:\" & wb.Name & " " & Format(Now, "dd-mm-yy h-mm-ss") & ".xls"


--
Regards Ron de Bruin
http://www.rondebruin.nl


"bbc1" wrote in message ...
HI I have a workbook that user's use to input changed data each day into
severval different worksheets, once data is entered they have to save it as
filename(date) what I need is a macro that will close the saved workbook and
re-open the original.
eg saved worksheet is tallysheet28-8-05 original workbook tallysheet






All times are GMT +1. The time now is 07:15 PM.

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