Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
code to delete sheets not in use based on a cell's drop down list | Excel Worksheet Functions | |||
Rename Sheets but..... | Excel Programming | |||
Rename Sheets based on date range | Excel Programming | |||
Rename Multiple Sheets from a List of Available Names | Excel Programming | |||
Rename sheets | Excel Programming |