LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Updating Worksheet Names for Rolling-12 Report

I have 13 worksheets in my workbook. For Sheet2 to Sheet13, I want the sheet
name to reflect its own cell A5. I have code in Sheet1 to accomplish this
task for the subsequent 12 sheets, but currently it only changes the 2nd
worksheet name and I can't figure out why. See below:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim i As Long
Dim Counter As Long
Let Counter = Worksheets.Count
On Error Resume Next
For i = 2 To Counter
Sheets(i).Name = Cells(5, 1).Value
Next i
On Error GoTo 0
End Sub

How can I get the code to update all 12 worksheet names? Here's some
reference information to see how the names are derived from the target cells:

Sheet1 is named "Settings" and is the only sheet with a fixed name. Because
workbooks are based on a rolling 12 month period, cell B17 is a variable
month field currently set to "January" and B18 is a variable year field
currently set to "2005".

Cell A5 of Sheet1 is =B17&" "&B18
Cell A5 of Sheet2 is ="Settings!B17&" "&Settings!B18"+0
Cell A5 of Sheet3 is =DATEVALUE(Settings!B17&Settings!B18)+32
Cell A5 of Sheet4 is =DATEVALUE(Settings!B17&Settings!B18)+64
Cell A5 of Sheet5 is =DATEVALUE(Settings!B17&Settings!B18)+96

Cell A5 of Sheet6 to Sheet13 is the same, each with a higher multiple of 32
so that it displays the next month in sequence.

Any Ideas on how to make this work?

Thanks,
Damian Carrillo

 
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
Updating Pivot Table report mathel Excel Discussion (Misc queries) 1 November 17th 08 11:13 PM
Create auto updating data validation list from all worksheet names fryguy Excel Worksheet Functions 7 December 11th 07 08:59 PM
YTD value minus prev mth value = curent month - Rolling Report karenm Excel Worksheet Functions 0 September 27th 07 09:16 PM
How do I set up a rolling monthly report in Excel? shaag Excel Discussion (Misc queries) 0 February 9th 06 12:51 AM
return all worksheet tab names and chart sheet tab names in report - an example DataFreakFromUtah Excel Programming 2 October 6th 04 08:09 PM


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

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

About Us

"It's about Microsoft Excel"