Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have 52 worksheets, for each week of the year. In each worksheet, the
beginning date is in A2. I would like to show the beginning date as the tab name, but I understand that I can't have a "/" in the tab name. Any suggestions, without physically renaming each sheet? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Leave your A2 cells alone.
Enter and run this small macro: Sub tabnames() For Each w In Worksheets w.Activate w.Name = Format(Range("A2").Value, "m-d-yyyy") Next End Sub Each tab will be re-named to the contents of A2, but formatted as a legal tabname. -- Gary''s Student "cursednomore" wrote: I have 52 worksheets, for each week of the year. In each worksheet, the beginning date is in A2. I would like to show the beginning date as the tab name, but I understand that I can't have a "/" in the tab name. Any suggestions, without physically renaming each sheet? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Gary's Studaent had it perfect!! Thanks very much!!
"Gary''s Student" wrote: Leave your A2 cells alone. Enter and run this small macro: Sub tabnames() For Each w In Worksheets w.Activate w.Name = Format(Range("A2").Value, "m-d-yyyy") Next End Sub Each tab will be re-named to the contents of A2, but formatted as a legal tabname. -- Gary''s Student "cursednomore" wrote: I have 52 worksheets, for each week of the year. In each worksheet, the beginning date is in A2. I would like to show the beginning date as the tab name, but I understand that I can't have a "/" in the tab name. Any suggestions, without physically renaming each sheet? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Almost. Activation of each sheet is not required.
-- Don Guillett SalesAid Software "cursednomore" wrote in message ... Gary's Studaent had it perfect!! Thanks very much!! "Gary''s Student" wrote: Leave your A2 cells alone. Enter and run this small macro: Sub tabnames() For Each w In Worksheets w.Activate w.Name = Format(Range("A2").Value, "m-d-yyyy") Next End Sub Each tab will be re-named to the contents of A2, but formatted as a legal tabname. -- Gary''s Student "cursednomore" wrote: I have 52 worksheets, for each week of the year. In each worksheet, the beginning date is in A2. I would like to show the beginning date as the tab name, but I understand that I can't have a "/" in the tab name. Any suggestions, without physically renaming each sheet? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Maybe this..........
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Range("B7").Value < shname Then shname = Format(Range("b7").Value, "m_d_yy") End If Me.Name = shname End Sub Vaya con Dios, Chuck, CABGx3 "cursednomore" wrote: I have 52 worksheets, for each week of the year. In each worksheet, the beginning date is in A2. I would like to show the beginning date as the tab name, but I understand that I can't have a "/" in the tab name. Any suggestions, without physically renaming each sheet? |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This will name the sheet 01-01 if any valid date in cell a1
Sub namesheetfromcell() ActiveSheet.Name = Format(Range("a1"), "mm-dd") End Sub to do for all sheets for each ws in worksheets ws.name=Format(ws.Range("a1"), "mm-dd") next You could even use Wk1 Wk2 etc by Sub nameshts() For i = 1 To 5 Sheets(i).Name = "WK" & i Next End Sub -- Don Guillett SalesAid Software "cursednomore" wrote in message ... I have 52 worksheets, for each week of the year. In each worksheet, the beginning date is in A2. I would like to show the beginning date as the tab name, but I understand that I can't have a "/" in the tab name. Any suggestions, without physically renaming each sheet? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA: For Count, when count changes from cell to cell | Excel Discussion (Misc queries) | |||
Cell References | Excel Discussion (Misc queries) | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Possible Lookup Table | Excel Worksheet Functions | |||
GET.CELL | Excel Worksheet Functions |