Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 37
Default can worksheet names be changed by changing certain cells?

I have a model with dummy names presently. I need some way to change the
worksheet names when the user chnges them in some cells in a seperate
worksheet. What i need is a link to the worksheet names to a cell in another
worksheet. and when this cell is edited the worksheet name also changes.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default can worksheet names be changed by changing certain cells?

Apply these event macros in code of sheet containing sheet names:
Public oldname As String

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Worksheets(oldname).Name = Target.Value
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
oldname = Target.Value
End If
End Sub

Regards,
Stefi


€žanand€ ezt Ã*rta:

I have a model with dummy names presently. I need some way to change the
worksheet names when the user chnges them in some cells in a seperate
worksheet. What i need is a link to the worksheet names to a cell in another
worksheet. and when this cell is edited the worksheet name also changes.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default can worksheet names be changed by changing certain cells?

It would be better to put the worksheet names in say the next column and
pick it up from there rather than code it.

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit
Application.EnableEvents = False

If Target.Column = 1 Then
Worksheets(Target.Offset(0,1).Value).Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

--
HTH

Bob

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

"Stefi" wrote in message
...
Apply these event macros in code of sheet containing sheet names:
Public oldname As String

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Worksheets(oldname).Name = Target.Value
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
oldname = Target.Value
End If
End Sub

Regards,
Stefi


"anand" ezt írta:

I have a model with dummy names presently. I need some way to change the
worksheet names when the user chnges them in some cells in a seperate
worksheet. What i need is a link to the worksheet names to a cell in
another
worksheet. and when this cell is edited the worksheet name also changes.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default can worksheet names be changed by changing certain cells?

It's nice, Bob! I would add a line after
Worksheets(Target.Offset(0,1).Value).Name = Target.Value

to ensure that the method works next time when the user changes sheet name:
Target.Offset(0, 1).Value = Target.Value

Regards,
Stefi


€žBob Phillips€ ezt Ã*rta:

It would be better to put the worksheet names in say the next column and
pick it up from there rather than code it.

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit
Application.EnableEvents = False

If Target.Column = 1 Then
Worksheets(Target.Offset(0,1).Value).Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

--
HTH

Bob

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

"Stefi" wrote in message
...
Apply these event macros in code of sheet containing sheet names:
Public oldname As String

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Worksheets(oldname).Name = Target.Value
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
oldname = Target.Value
End If
End Sub

Regards,
Stefi


"anand" ezt Ã*rta:

I have a model with dummy names presently. I need some way to change the
worksheet names when the user chnges them in some cells in a seperate
worksheet. What i need is a link to the worksheet names to a cell in
another
worksheet. and when this cell is edited the worksheet name also changes.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default can worksheet names be changed by changing certain cells?

That strikes me as eminently sensible :-)

--
HTH

Bob

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

"Stefi" wrote in message
...
It's nice, Bob! I would add a line after
Worksheets(Target.Offset(0,1).Value).Name = Target.Value

to ensure that the method works next time when the user changes sheet
name:
Target.Offset(0, 1).Value = Target.Value

Regards,
Stefi


"Bob Phillips" ezt írta:

It would be better to put the worksheet names in say the next column and
pick it up from there rather than code it.

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit
Application.EnableEvents = False

If Target.Column = 1 Then
Worksheets(Target.Offset(0,1).Value).Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

--
HTH

Bob

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

"Stefi" wrote in message
...
Apply these event macros in code of sheet containing sheet names:
Public oldname As String

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Worksheets(oldname).Name = Target.Value
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
oldname = Target.Value
End If
End Sub

Regards,
Stefi


"anand" ezt írta:

I have a model with dummy names presently. I need some way to change
the
worksheet names when the user chnges them in some cells in a seperate
worksheet. What i need is a link to the worksheet names to a cell in
another
worksheet. and when this cell is edited the worksheet name also
changes.






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
Changing worksheet names Carolyn Excel Worksheet Functions 1 November 10th 06 05:21 AM
Worksheet (tab names) in cells wdogolf Excel Discussion (Misc queries) 3 October 10th 06 12:10 AM
changing names in Cells of the Sales Pipeline management template? Crusade Excel Worksheet Functions 2 July 2nd 06 04:09 PM
... After I protected my worksheet, some cells can be changed... Dr. Darrell Setting up and Configuration of Excel 3 February 25th 06 02:23 PM
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. [email protected] Excel Discussion (Misc queries) 0 September 22nd 05 04:39 PM


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

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

About Us

"It's about Microsoft Excel"