ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Naming Sheets using a range in another worksheet (https://www.excelbanter.com/excel-worksheet-functions/110583-naming-sheets-using-range-another-worksheet.html)

gazza

Naming Sheets using a range in another worksheet
 
Is there any way I can put names in a range on one sheet and then
automatically rename sheets with the names listed in the range without
manually renaming each sheet
--
gazza

Muhammed Rafeek M

Naming Sheets using a range in another worksheet
 
use macro

eg:
u have 5 sheets in a workbook
sheet1 A1 to A5 values are
New Name1
New Name2
New Name3
New Name4
New Name5

according to that if you want change sheet name, use below mentioned code:

Sub change_sheet_Name()
Dim i As Integer
For i = 1 To 5 ' or you can use thisworkbook.sheets.count

ThisWorkbook.Sheets(i).Name = ThisWorkbook.Sheets(1).Range("A" & i).Value

Next i
End Sub


Note: cell values should be unique

PLS DO RATE

"gazza" wrote:

Is there any way I can put names in a range on one sheet and then
automatically rename sheets with the names listed in the range without
manually renaming each sheet
--
gazza


Bob Phillips

Naming Sheets using a range in another worksheet
 
For Each sh in Activeworkbook.Worksheets
i = i + 1
sh.Name = Cells(i,"A").Value
Next sh

assumes the names are in A1:An on the active worksheet

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"gazza" wrote in message
...
Is there any way I can put names in a range on one sheet and then
automatically rename sheets with the names listed in the range without
manually renaming each sheet
--
gazza




Don Guillett

Naming Sheets using a range in another worksheet
 
'assumes sheet number and list are the same number. 5 sheets & 5 names
Sub nametabs()
For i = 2 To Cells(Rows.Count, "a").End(xlUp).Row
Sheets(i).Name = Cells(i, "a")
Next
End Sub

--
Don Guillett
SalesAid Software

"gazza" wrote in message
...
Is there any way I can put names in a range on one sheet and then
automatically rename sheets with the names listed in the range without
manually renaming each sheet
--
gazza





All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com