Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Husker87
 
Posts: n/a
Default Question about tab naming and referenced cells

I have the same question but just want to link one worksheet tab name
automatically to a cell in the worksheet. Change the cell and the tab name
on the worksheet changes€¦ can you help with the VBA code for that? Many
Thanks€¦.


"JE McGimpsey" wrote:

One way:

Put this in your worksheet code module (right-click your worksheet tab
and choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim i As Long
If Not Intersect(Target, Range("A4").Resize( _
Worksheets.Count, 1)) Is Nothing Then
On Error Resume Next 'in case invalid sheet name
For i = 2 To Worksheets.Count
Sheets(i).Name = Cells(i + 2, 1).Value
Next i
On Error GoTo 0
End If
End Sub

The update to references will occur automatically.


In article ,
"mbowen83" wrote:

Is there a way to have a certain worksheet assume the text in a cell (i.e.
sheet 2 renaming itself to whatever is in cell a4 of sheet 1, as well as
sheet 3 renamed to what is in a5 of sheet 1, and so forth), and then
automatically updating any reference to the renamed sheet throuhout the
workbook.


  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Take a look he

http://www.mcgimpsey.com/excel/event...efromcell.html


In article ,
"Husker87" wrote:

I have the same question but just want to link one worksheet tab name
automatically to a cell in the worksheet. Change the cell and the tab name
on the worksheet changes€¦ can you help with the VBA code for that? Many
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



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