#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Tab Naming

'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.



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 310
Default Tab Naming

Thank. I found where to enter the code below, but now what. I click on save
while in the view code area and nothing is happening to the tab names.

"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.




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming Cell in diffetn worksheet Yan Excel Worksheet Functions 10 September 26th 06 07:36 PM
intersection naming transport between files BorisS Excel Discussion (Misc queries) 0 June 29th 06 08:37 PM
Tab naming Pedro AM Excel Discussion (Misc queries) 1 April 3rd 06 12:31 PM
E2003 naming ranges correctly Estrelle71 Excel Discussion (Misc queries) 1 July 22nd 05 02:02 PM
Naming ranges? pmw5 Excel Discussion (Misc queries) 2 March 4th 05 06:57 PM


All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"