LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Rename Sheets based on List

Just to make it closer to what you need:

Create a named range to hold the sheet names with a dynamically expaning
reference:

=OFFSET(Data!$A$1,0,0,COUNTA(Data!$A:$A), COUNTA(Data!$1:$1))

Iterate through each cell of the named range, setting the name to the
worksheets, corresponding by number.

Make sure the number of worksheets is sufficient to cover the cell in the
range, so that you might need to add worksheets to match the number of days.





"James Igoe" wrote:

Private Sub Update_RenameWorksheets_Sheet(ByRef wkbReport As Workbook, ByVal
strNewNames as String)

Dim strTempHolder As String
Dim strTempHolder_Initial As String
Dim varSheets As Variant
Dim intCounter As Integer

strTempHolder_Initial = strNewNames

If strTempHolder_Initial < "NULL" Then

varSheets = Split(strTempHolder_Initial, ",")

For intCounter = 0 To UBound(varSheets)

'todo: extend to avoid conflict with names

If Len(Trim(varSheets(intCounter))) 0 Then
wkbReport.Worksheets(intCounter + 1).Name =
Left(Trim(varSheets(intCounter)), 31)
End If

Next intCounter

End If

End Sub

"Keep It Simple Stupid" wrote:

I know you can rename the sheet based on whatever is in a particular cell on
that sheet, but I would like to have a "Master" sheet with a range that I
would like to rename the rest of the sheets.

(Since there are many nuances to this workbook, I really want to do it this
way). Basically, each day of the month has a different tab (each month has a
different workbook). So on this "Master Sheet" I would like to just list the
days of the month (i.e. M_11-16-09), hit the play button, and magically all
the existing sheets will be named to each one of those dates. There are
plenty of Sheets that can be renamed, I just need to figure out how to set up
the loop.

 
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
code to delete sheets not in use based on a cell's drop down list kangasnat Excel Worksheet Functions 2 September 20th 07 03:08 AM
Rename Sheets but..... chemicals Excel Programming 2 March 16th 07 03:46 PM
Rename Sheets based on date range Steve[_79_] Excel Programming 2 November 4th 05 03:43 AM
Rename Multiple Sheets from a List of Available Names prkhan56 Excel Programming 5 April 4th 05 06:07 PM
Rename sheets cottage6 Excel Programming 3 February 3rd 05 11:28 PM


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