Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default tab naming from a set cell

I am having problem with work sheet naming from a cell I know this has
been posted before by other people but I can't get it to work i copy
and paste what they say and i just can't get it to work

On sheet 1 cell c8 I want sheet 2 tab name Tom or a number
On sheet 1 cell c9 I want sheet 3 tab name Ray or a number

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default tab naming from a set cell

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C8:C9" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Address = "$C$8" Then
Worksheets("Sheet2").Name = .Value
Else
Worksheets("Sheet3").Name = .Value
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"duckie" wrote in message
ups.com...
I am having problem with work sheet naming from a cell I know this has
been posted before by other people but I can't get it to work i copy
and paste what they say and i just can't get it to work

On sheet 1 cell c8 I want sheet 2 tab name Tom or a number
On sheet 1 cell c9 I want sheet 3 tab name Ray or a number



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 sheets from a cell value Tony4X4 Excel Discussion (Misc queries) 12 September 7th 09 01:55 PM
Naming a cell Yan Cossette Excel Worksheet Functions 8 September 23rd 06 07:40 PM
Naming The Tabsheet from a cell JackR Excel Discussion (Misc queries) 3 March 14th 06 04:16 PM
What is wrong with naming a cell as c? vezerid Excel Discussion (Misc queries) 4 January 31st 06 08:57 PM
Naming a cell mike Excel Worksheet Functions 2 January 12th 05 11:31 PM


All times are GMT +1. The time now is 12:53 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"