View Single Post
  #1  
Old May 27th, 2010, 10:47 PM posted to microsoft.public.excel.worksheet.functions
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default CELL CONTENTS WRITE TO TAB NAME

Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.


Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:A10")) Is Nothing Then
If Target.Count = 1 Then
On Error Resume Next
ThisWorkbook.Sheets(Target.Row + 1).Name = Target.Text
End If
End If
Application.EnableEvents = True
End Sub

--
Jacob (MVP - Excel)


"Pam M" wrote:

I know there is a way to reference a worksheet name in a cell. Is there an
automated way to name the sheet based on a cells contents? I have summary
sheet with 200 names on it. Each name should have a corresponding worksheet.
So, I want cell A1 with name1 to automatically name sheet2 as name1, and so
on. That way, we have to update only the summary sheet and the worksheets
will always co-incide.