Can Tab name in worksheet change automatically by referencing a ce

  • Thread starter Thread starter Alvyn
  • Start date Start date
A

Alvyn

Dear Sir/Mdm,

Anyone kind enough to advice whether the following can be achieve and how?

Default name for tab in an Excel sheet is Sheet 1, Sheet 2 etc.
Is it possible to automatically change the name of the tab based on the data
on Sheet 6?

Eg, In the same workbook, Column A1 to A5 in Sheet 6 contains the following :

A1=A
A2=B
A3=C
A4=D
A5=E

Can I achieve to have Sheet1 change to A, Sheet2 to B, Sheet3 to C and etc?

Thanks

Alvyn
 
The code below will name each sheet as the text or value in the Range of
cells that you choose:
Sub renamre()
Sheets("Sheet1").Activate
n = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To n
Sheets(i + 1).Name = Cells(i, 1).Value
Next
End Sub


Regards,
Ryan---
 
Dear Ryan

Thanks for the code. However, could you please elaborate where should I
insert this code into?

Thanks :)

Alvyn
 
Back
Top