Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've read every posting I could find for renaming sheet tabs, but haven't
stumbled upon a solution. I want to take a list on a worksheet and from that list (in sequential order A1-A100), rename every tab in the workbook. Is this possible? -- DanaK |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub reNameSheets()
Const listColumn As String = "A" Dim ws As Worksheet Dim SheetCount As Integer Dim listStartingRow As Long SheetCount = ActiveWorkbook.Worksheets.Count listStartingRow = 2 For Each ws In ThisWorkbook.Worksheets If ws.Name < "Sheet1" Then Worksheets(ws.Name).Name = Range(listColumn & i).Value SheetCount = SheetCount + 1 listStartingRow = listStartingRow + 1 End If Next End Sub "DanaK" wrote: I've read every posting I could find for renaming sheet tabs, but haven't stumbled upon a solution. I want to take a list on a worksheet and from that list (in sequential order A1-A100), rename every tab in the workbook. Is this possible? -- DanaK |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub reNameSheets()
Const listColumn As String = "A" Dim ws As Worksheet Dim SheetCount As Integer Dim listStartingRow As Long SheetCount = ActiveWorkbook.Worksheets.Count listStartingRow = 2 For Each ws In ThisWorkbook.Worksheets If ws.Name < "Sheet1" Then Worksheets(ws.Name).Name = Range(listColumn & listStartingRow).Value SheetCount = SheetCount + 1 listStartingRow = listStartingRow + 1 End If Next End Sub "DanaK" wrote: I've read every posting I could find for renaming sheet tabs, but haven't stumbled upon a solution. I want to take a list on a worksheet and from that list (in sequential order A1-A100), rename every tab in the workbook. Is this possible? -- DanaK |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe something like:
Option Explicit Sub testme() Dim iRow as long with activesheet for irow = 1 to .cells(.rows.count,"A").end(xlup).row sheets(irow).name = .cells(irow,"A").value next irow end with End with This could fail if you have invalid names in column A and/or there are duplicate names or sheets with the same name already existing. Or if you don't have enough sheets! DanaK wrote: I've read every posting I could find for renaming sheet tabs, but haven't stumbled upon a solution. I want to take a list on a worksheet and from that list (in sequential order A1-A100), rename every tab in the workbook. Is this possible? -- DanaK -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fellas! Thank, thank you! It's working perfect. I am learning SO much
here....you are the best! -- DanaK "Dave Peterson" wrote: Maybe something like: Option Explicit Sub testme() Dim iRow as long with activesheet for irow = 1 to .cells(.rows.count,"A").end(xlup).row sheets(irow).name = .cells(irow,"A").value next irow end with End with This could fail if you have invalid names in column A and/or there are duplicate names or sheets with the same name already existing. Or if you don't have enough sheets! DanaK wrote: I've read every posting I could find for renaming sheet tabs, but haven't stumbled upon a solution. I want to take a list on a worksheet and from that list (in sequential order A1-A100), rename every tab in the workbook. Is this possible? -- DanaK -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Most simply, and assuming the list of new sheet names is on the active sheet and that the sheets to be renamed are those in the active workbook Code: -------------------- Sub x() Dim i As Long For i = 1 To ActiveWorkbook.Sheets.Count ActiveWorkbook.Sheets(i).Name = ActiveSheet.Cells(i, "A").Text Next i End Sub -------------------- More rigorous code would first check for duplicates in the list of names, check for valid sheet names, and work around renaming sheets that have a name conflict with sheets yet to be named. -- shg ------------------------------------------------------------------------ shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=27770 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
rename sheet tabs in excel | Excel Discussion (Misc queries) | |||
Creating Sheet Tabs from a list | Excel Discussion (Misc queries) | |||
How can I copy sheet, fill in cell from list and rename worksheet? | Excel Programming | |||
Name sheet tabs with a cell list | Excel Discussion (Misc queries) | |||
RENAME SHEET TABS AOYUMATICALLY | Excel Discussion (Misc queries) |