View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike Rogers Mike Rogers is offline
external usenet poster
 
Posts: 194
Default *How can you rename a tab based on a cell value

SAM SEBAIHI

The following came from this disussion group. I have had it for a couple of
years and can not remember to whom I should give credit. It works well but
it is not mine!

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then 'Change range to
your range & Sheet to your sheet
If ActiveSheet.Name = Sheet2.Name Then ' in case of grouped sheets
ActiveSheet.Name = Target.Value
End If
End If
End Sub

This needs to be placed in the worksheet code. Select the tab you want to
use, on the tab right click and select "view Code" place it in the window on
the right. Make the necessary changes and it should work for you.

Does this meet your needs?

Mike Rogers

"SAM SEBAIHI" wrote:


How can you rename a tab based on a cell? example,

if cell A1 contains John then the tab of sheet (1) renamed to john.

thank you,