Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default tab names from cell values

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default tab names from cell values

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default tab names from cell values

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   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default tab names from cell values

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default tab names from cell values

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
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
VBA: For Count, when count changes from cell to cell LenS Excel Discussion (Misc queries) 18 January 4th 07 12:53 AM
Cell References [email protected] Excel Discussion (Misc queries) 2 November 15th 06 11:37 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 05:12 PM.

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

About Us

"It's about Microsoft Excel"