Thread: Tab Naming
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Tab Naming

Note that with both Bob's and PCLives code you could run into an issue if the
value in D1 is the repeat of an existing tab name or if the text in D1 is too
long, or if the text in D1 is "history" (quirky little bug with XL that you
can not name a sheet History)... If that is going to be an issue then you
should add in an error handler to the code which we can help you with if you
need...
--
HTH...

Jim Thomlinson


"Bob Phillips" wrote:

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
If Not Intersect(Range("D1"), Target) Is Nothing Then
Sh.Name = Target.Value
End If
End Sub


--
HTH

Bob Phillips

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

"Michelle" wrote in message
...
I have a workbook with 75 worksheets (tabs) and would like the value in

field
D1 to be the name of the tab? Is this possible and how would I do this?
Please help. Thanks.