Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Changing Tabs to Specific Cells
Is there a way to change the tab names (20 of them) to the cells in say
A1:A20? When the names are changed in the cells, I need the tabs names to reflect what the cells reflect. |
#2
|
|||
|
|||
Changing Tabs to Specific Cells
Darren-
Place this code in the appropriate sheet module: Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range Set rng = Me.[A1:A20] If Target.Row ActiveWorkbook.Worksheets.Count Then Exit Sub On Error GoTo ErrHandler Sheets(Target.Row).Name = Target.Value Exit Sub ErrHandler: MsgBox "Invalid sheet name. Try again." Target.Select End Sub --- HTH Jason Atlanta, GA "Darren" wrote: Is there a way to change the tab names (20 of them) to the cells in say A1:A20? When the names are changed in the cells, I need the tabs names to reflect what the cells reflect. |
#3
|
|||
|
|||
Changing Tabs to Specific Cells
Oops...forgot one extremely important line of code:
If Intersect(Target, rng) Is Nothing Then Exit Sub Add this under the "Set rng = ..." line. Sorry. Jason "Jason Morin" wrote: Darren- Place this code in the appropriate sheet module: Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range Set rng = Me.[A1:A20] If Target.Row ActiveWorkbook.Worksheets.Count Then Exit Sub On Error GoTo ErrHandler Sheets(Target.Row).Name = Target.Value Exit Sub ErrHandler: MsgBox "Invalid sheet name. Try again." Target.Select End Sub --- HTH Jason Atlanta, GA "Darren" wrote: Is there a way to change the tab names (20 of them) to the cells in say A1:A20? When the names are changed in the cells, I need the tabs names to reflect what the cells reflect. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
changing the way Excel displays selected cells | Excel Discussion (Misc queries) | |||
Formula for counting specific cells with value greater than 0 | Excel Discussion (Misc queries) | |||
My excel 2003 wont let me fill cells with color or color the tabs. | New Users to Excel | |||
Showing zero in specific cells | Excel Discussion (Misc queries) | |||
print specific cells | Excel Discussion (Misc queries) |