Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Rename Sheet tabs from list......

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Rename Sheet tabs from list......

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Rename Sheet tabs from list......

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Rename Sheet tabs from list......

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Rename Sheet tabs from list......

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rename Sheet tabs from list......


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
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
rename sheet tabs in excel blantyreson Excel Discussion (Misc queries) 2 August 22nd 07 06:31 PM
Creating Sheet Tabs from a list PFLY Excel Discussion (Misc queries) 3 May 11th 07 06:10 PM
How can I copy sheet, fill in cell from list and rename worksheet? [email protected] Excel Programming 4 July 31st 06 07:44 AM
Name sheet tabs with a cell list deeds Excel Discussion (Misc queries) 2 June 9th 06 04:22 PM
RENAME SHEET TABS AOYUMATICALLY RENAME SHEET TAB NAMES VIA MACRO'S Excel Discussion (Misc queries) 3 February 3rd 05 01:06 PM


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