Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default changing dates in worksheets - help

I have 10 different excel spreadsheets, each with 52 worksheets with a date.
It is our new year and the dates were manually entered. my question....

is there a formula i can enter so it picks up the worksheet before it and
adds 7 days to the new worksheets so i do not have to manually change all of
these dates on all 52 worksheets.

right now i have been clicking on each worksheet and manually chnaging the
dates, but getting to be a pain.

Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default changing dates in worksheets - help

Paste this code into a standard module. Note Comments through code before
running. Write back if problems.

Sub CreateWeeklySheets()
'This macro assumes you have a New Workbook with only one Worksheet
'with the Name 07/02/2007 (First Monday) of the new year.
Dim TempName As String
Dim i As Integer
Dim c As Integer ' Number of sheets to add
c = 51 'additional weeks to create beyond first sheet
Application.ScreenUpdating = False
For i = 1 To c
'Set Nws = Worksheets.Add After:=Worksheets(i)
TempName = DateValue(ActiveSheet.Name) + 7
Worksheets.Add After:=Worksheets(i)
ActiveSheet.Name = Format(TempName, "mm-dd-yyyy")
Next i
Application.ScreenUpdating = True
End Sub

HTH,

Jim May
"LEOPARDSHIDEAWAY" wrote:

I have 10 different excel spreadsheets, each with 52 worksheets with a date.
It is our new year and the dates were manually entered. my question....

is there a formula i can enter so it picks up the worksheet before it and
adds 7 days to the new worksheets so i do not have to manually change all of
these dates on all 52 worksheets.

right now i have been clicking on each worksheet and manually chnaging the
dates, but getting to be a pain.

Thank you!

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
changing dates. chesty Excel Worksheet Functions 1 June 14th 06 03:04 PM
Changing Dates JohnG Excel Discussion (Misc queries) 1 May 17th 05 08:15 PM
Changing Dates JohnG Excel Discussion (Misc queries) 2 May 17th 05 06:22 PM
Changing Dates in Excel Jackie Excel Worksheet Functions 3 January 14th 05 08:16 PM
pasted dates changing rubber Excel Discussion (Misc queries) 1 January 12th 05 12:38 PM


All times are GMT +1. The time now is 05:15 AM.

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"