Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|