Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Macro to create a Weekly Workbook

I have a Master Workbook which I want to be able to create copies of as a
Weekly Workbook based on the initial date in cell G7 of the index page which
is the start-up page. Then having the copies automatically renamed as the
following weeks date
if this is possible does anyone have such a code

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Macro to create a Weekly Workbook

Try the below..

Sub Macro1()
Dim dtTemp As Date
dtTemp = Range("G7")
ActiveSheet.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = Format(DateAdd("d", 7, dtTemp), "dd-mm-yyyy")
Range("G7") = dtTemp + 7
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

I have a Master Workbook which I want to be able to create copies of as a
Weekly Workbook based on the initial date in cell G7 of the index page which
is the start-up page. Then having the copies automatically renamed as the
following weeks date
if this is possible does anyone have such a code

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Macro to create a Weekly Workbook

You almost got it right, The macro you provided copied the index sheet with
the updated date and place it at the end of the active workbook.
I'm sorry that is not what I meant. What I want Im finding it difficult to
explain so please bear with me. If I simply copy a Workbook while it is
unopened I would get a copy with the same name with the word €œcopy€ added.
This is the type of copy macro that I actually want that it would copy the
whole workbook, change the names to a date and save it to the same file where
the Master Workbook is.


"Jacob Skaria" wrote:

Try the below..

Sub Macro1()
Dim dtTemp As Date
dtTemp = Range("G7")
ActiveSheet.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = Format(DateAdd("d", 7, dtTemp), "dd-mm-yyyy")
Range("G7") = dtTemp + 7
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

I have a Master Workbook which I want to be able to create copies of as a
Weekly Workbook based on the initial date in cell G7 of the index page which
is the start-up page. Then having the copies automatically renamed as the
following weeks date
if this is possible does anyone have such a code

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Macro to create a Weekly Workbook

The below macro will create a copy OR save the current workbook in the same
location with the name as date in G7 + 7 days...

Sub Macro()

Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim wbBook As Workbook
Dim dtTemp As Date
Dim strFile As String
strFile = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
dtTemp = Range("G7")
Range("G7") = dtTemp + 7
ActiveWorkbook.SaveAs ActiveWorkbook.Path & "\" & _
Format(DateAdd("d", 7, dtTemp), "dd-mm-yyyy")
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

You almost got it right, The macro you provided copied the index sheet with
the updated date and place it at the end of the active workbook.
I'm sorry that is not what I meant. What I want Im finding it difficult to
explain so please bear with me. If I simply copy a Workbook while it is
unopened I would get a copy with the same name with the word €œcopy€ added.
This is the type of copy macro that I actually want that it would copy the
whole workbook, change the names to a date and save it to the same file where
the Master Workbook is.


"Jacob Skaria" wrote:

Try the below..

Sub Macro1()
Dim dtTemp As Date
dtTemp = Range("G7")
ActiveSheet.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = Format(DateAdd("d", 7, dtTemp), "dd-mm-yyyy")
Range("G7") = dtTemp + 7
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

I have a Master Workbook which I want to be able to create copies of as a
Weekly Workbook based on the initial date in cell G7 of the index page which
is the start-up page. Then having the copies automatically renamed as the
following weeks date
if this is possible does anyone have such a code

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Macro to create a Weekly Workbook

You Beauty thats just Marvellous Thank you so much

"Jacob Skaria" wrote:

The below macro will create a copy OR save the current workbook in the same
location with the name as date in G7 + 7 days...

Sub Macro()

Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim wbBook As Workbook
Dim dtTemp As Date
Dim strFile As String
strFile = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
dtTemp = Range("G7")
Range("G7") = dtTemp + 7
ActiveWorkbook.SaveAs ActiveWorkbook.Path & "\" & _
Format(DateAdd("d", 7, dtTemp), "dd-mm-yyyy")
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

You almost got it right, The macro you provided copied the index sheet with
the updated date and place it at the end of the active workbook.
I'm sorry that is not what I meant. What I want Im finding it difficult to
explain so please bear with me. If I simply copy a Workbook while it is
unopened I would get a copy with the same name with the word €œcopy€ added.
This is the type of copy macro that I actually want that it would copy the
whole workbook, change the names to a date and save it to the same file where
the Master Workbook is.


"Jacob Skaria" wrote:

Try the below..

Sub Macro1()
Dim dtTemp As Date
dtTemp = Range("G7")
ActiveSheet.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = Format(DateAdd("d", 7, dtTemp), "dd-mm-yyyy")
Range("G7") = dtTemp + 7
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

I have a Master Workbook which I want to be able to create copies of as a
Weekly Workbook based on the initial date in cell G7 of the index page which
is the start-up page. Then having the copies automatically renamed as the
following weeks date
if this is possible does anyone have such a code

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro (I Think) To Update List in Workbook With Weekly Updates? Wart Excel Discussion (Misc queries) 9 June 11th 08 12:30 AM
Create Move Macro for Closed Workbook Roger Excel Discussion (Misc queries) 3 January 15th 08 02:19 AM
create personal macro workbook krispylala Excel Worksheet Functions 3 December 6th 07 04:38 PM
Macro to create new workbook and sheets Richard Excel Discussion (Misc queries) 1 July 31st 07 07:31 PM
Using a macro to create a macro in another workbook Gizmo63 Excel Worksheet Functions 2 May 15th 06 09:48 AM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"