Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
maximum number of worksheets | Excel Worksheet Functions | |||
How to protect and unprotect 30 worksheets in a file every month . | Excel Worksheet Functions | |||
Protect/unprotect all worksheets | Excel Worksheet Functions | |||
HELP! How do you--> Lock a set of rows but also link worksheets to | Excel Discussion (Misc queries) | |||
Assigning Cells in worksheets to other data in other worksheets. | Excel Discussion (Misc queries) |