Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Steve Walford
 
Posts: n/a
Default Renaming Worksheets

Is there any easy way to rename or name worksheets

I have a 52 page spread sheet, each page represents a week and is
named like so
1st January,8th January,15thJanary etc

The date used represents the first day of the week (Monday)

The next year I copy the spreadsheet and delete all the data, but the
date on the page does no correspond to Monday so I have to rename all
the sheets

Is there an easier way

Thanks

  #2   Report Post  
Gary Brown
 
Posts: n/a
Default

How about WEEK01, WEEK02, WEEK03.... ?
HTH,
Gary Brown


"Steve Walford" wrote:

Is there any easy way to rename or name worksheets

I have a 52 page spread sheet, each page represents a week and is
named like so
1st January,8th January,15thJanary etc

The date used represents the first day of the week (Monday)

The next year I copy the spreadsheet and delete all the data, but the
date on the page does no correspond to Monday so I have to rename all
the sheets

Is there an easier way

Thanks


  #3   Report Post  
Gary Brown
 
Posts: n/a
Default

That said,
Except for the 'st', 'nd', 'th', try this...
'/=================================================/
Sub Test_Change_WkshtName()
Dim wksht As Worksheet
Dim dtStart As Date, dtWksht As Date

'1st Monday of the Year
dtStart = DateValue("01/04/2005")

dtWksht = dtStart

For Each wksht In Worksheets
wksht.Name = Format(dtWksht, "dd mmmm")
dtWksht = dtWksht + 7
Next wksht

End Sub
'/=================================================/
HTH,
Gary Brown


"Gary Brown" wrote:

How about WEEK01, WEEK02, WEEK03.... ?
HTH,
Gary Brown


"Steve Walford" wrote:

Is there any easy way to rename or name worksheets

I have a 52 page spread sheet, each page represents a week and is
named like so
1st January,8th January,15thJanary etc

The date used represents the first day of the week (Monday)

The next year I copy the spreadsheet and delete all the data, but the
date on the page does no correspond to Monday so I have to rename all
the sheets

Is there an easier way

Thanks


  #4   Report Post  
Steve Walford
 
Posts: n/a
Default

Garry this did exactly what I wanted

Many Thanks

Steve


On Tue, 29 Mar 2005 12:37:07 -0800, "Gary Brown"
wrote:

That said,
Except for the 'st', 'nd', 'th', try this...
'/=================================================/
Sub Test_Change_WkshtName()
Dim wksht As Worksheet
Dim dtStart As Date, dtWksht As Date

'1st Monday of the Year
dtStart = DateValue("01/04/2005")

dtWksht = dtStart

For Each wksht In Worksheets
wksht.Name = Format(dtWksht, "dd mmmm")
dtWksht = dtWksht + 7
Next wksht

End Sub
'/=================================================/
HTH,
Gary Brown


"Gary Brown" wrote:

How about WEEK01, WEEK02, WEEK03.... ?
HTH,
Gary Brown


"Steve Walford" wrote:

Is there any easy way to rename or name worksheets

I have a 52 page spread sheet, each page represents a week and is
named like so
1st January,8th January,15thJanary etc

The date used represents the first day of the week (Monday)

The next year I copy the spreadsheet and delete all the data, but the
date on the page does no correspond to Monday so I have to rename all
the sheets

Is there an easier way

Thanks



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
maximum number of worksheets Shooter Excel Worksheet Functions 8 July 1st 06 06:38 AM
How to protect and unprotect 30 worksheets in a file every month . Protect & Unprotect Several Worksheets Excel Worksheet Functions 4 January 10th 05 01:29 PM
Protect/unprotect all worksheets Janna Excel Worksheet Functions 2 January 7th 05 01:01 AM
HELP! How do you--> Lock a set of rows but also link worksheets to FRUSTRATED Excel Discussion (Misc queries) 6 December 29th 04 10:05 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM


All times are GMT +1. The time now is 11:00 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"