#1   Report Post  
Posted to microsoft.public.excel.misc
ann
 
Posts: n/a
Default sheets


Hello,

I have five sheets and they are named by weeks (ex: 5-7-2006 to
5-13-2006, 5-14-2006 to 5-20-2006, etc.). In another sheet, Weekly
table, I need to put these sheet names in the first row. Basically,
whatever name you give to the five sheets, it should automatically
update the first row of the Weekly table sheet.

I tried to do thru macro: Go to the first sheet, right click and select
Rename and select Copy and paste the name of the sheet in the first row
(A1); Go to the second sheet, right click and select Rename and select
Copy and paste the second sheet name in A2. If I change the name of the
sheet, the macro looks for the old name of the sheet. So this doesn't
work

How can I automatically update A1, A2, etc with the name of the sheets
that I give in Excel?

Please help me find a formula (no VBA)!!

Thanks,

Ann


--
ann
------------------------------------------------------------------------
ann's Profile: http://www.excelforum.com/member.php...o&userid=17129
View this thread: http://www.excelforum.com/showthread...hreadid=554347

  #2   Report Post  
Posted to microsoft.public.excel.misc
mudraker
 
Posts: n/a
Default sheets


Ann

I know you said no VBA

but I don't know how to do it using a formula

this VBA code will work regardless of the sheet name.
It adds sheet name into A1 on every sheet

Sub SheetNames()
Dim wS As Worksheet
For Each wS In Worksheets
Range("a1").Value = wS.Name
Next wS
End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=554347

  #3   Report Post  
Posted to microsoft.public.excel.misc
ann
 
Posts: n/a
Default sheets


I tried the VBA and it picks name of the last sheet, but not from the
beginning.


--
ann
------------------------------------------------------------------------
ann's Profile: http://www.excelforum.com/member.php...o&userid=17129
View this thread: http://www.excelforum.com/showthread...hreadid=554347

  #4   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme
 
Posts: n/a
Default sheets

You said no VBA but I know of no function that returns a sheet name and if
there is such a function
I expect it can return only the active sheet name.
However, this simple sub seems to work OK

Sub macro2()
j = 1
For Each wks In Worksheets
Cells(j, 1).Value = wks.Name
j = j + 1
Next
End Sub

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"ann" wrote in message
...

Hello,

I have five sheets and they are named by weeks (ex: 5-7-2006 to
5-13-2006, 5-14-2006 to 5-20-2006, etc.). In another sheet, Weekly
table, I need to put these sheet names in the first row. Basically,
whatever name you give to the five sheets, it should automatically
update the first row of the Weekly table sheet.

I tried to do thru macro: Go to the first sheet, right click and select
Rename and select Copy and paste the name of the sheet in the first row
(A1); Go to the second sheet, right click and select Rename and select
Copy and paste the second sheet name in A2. If I change the name of the
sheet, the macro looks for the old name of the sheet. So this doesn't
work

How can I automatically update A1, A2, etc with the name of the sheets
that I give in Excel?

Please help me find a formula (no VBA)!!

Thanks,

Ann


--
ann
------------------------------------------------------------------------
ann's Profile:
http://www.excelforum.com/member.php...o&userid=17129
View this thread: http://www.excelforum.com/showthread...hreadid=554347



  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default sheets

You could put this kind of formula in the cells:

=MID(CELL("filename",'Sheet 2'!A1),
FIND("]",CELL("filename",'Sheet 2'!A1))+1,255)

Change the 'sheet 2' to your original sheet names.

When the user changes names, these formulas will change accordingly. (Yes, you
have to do a little work up front.)

And the workbook has to be saved at least once.



ann wrote:

Hello,

I have five sheets and they are named by weeks (ex: 5-7-2006 to
5-13-2006, 5-14-2006 to 5-20-2006, etc.). In another sheet, Weekly
table, I need to put these sheet names in the first row. Basically,
whatever name you give to the five sheets, it should automatically
update the first row of the Weekly table sheet.

I tried to do thru macro: Go to the first sheet, right click and select
Rename and select Copy and paste the name of the sheet in the first row
(A1); Go to the second sheet, right click and select Rename and select
Copy and paste the second sheet name in A2. If I change the name of the
sheet, the macro looks for the old name of the sheet. So this doesn't
work

How can I automatically update A1, A2, etc with the name of the sheets
that I give in Excel?

Please help me find a formula (no VBA)!!

Thanks,

Ann

--
ann
------------------------------------------------------------------------
ann's Profile: http://www.excelforum.com/member.php...o&userid=17129
View this thread: http://www.excelforum.com/showthread...hreadid=554347


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
David McRitchie
 
Posts: n/a
Default sheets

and you want it to automatically update upon renaming of sheets.
You have answers except for that -- I can only see problems with
this. Because you can rearrange sheet tabs besides renaming them.
and then if you rerun the macro then the data will not match the sheettab
name at the top of the row.

If you are going to use dates for sheet tabs, I would highly
recommend that you format them at yyyy-mm-dd
or as yyyy_mmdd as you would have a mess if you attempted
to sort your worksheet tabs with a macro with what you have.
http://www.mvps.org/dmcritchie/excel...#sortallsheets
the same format for dates in filenames is also advisible
http://www.mvps.org/dmcritchie/excel/backup.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"ann" wrote in message ...

Hello,

I have five sheets and they are named by weeks (ex: 5-7-2006 to
5-13-2006, 5-14-2006 to 5-20-2006, etc.). In another sheet, Weekly
table, I need to put these sheet names in the first row. Basically,
whatever name you give to the five sheets, it should automatically
update the first row of the Weekly table sheet.

I tried to do thru macro: Go to the first sheet, right click and select
Rename and select Copy and paste the name of the sheet in the first row
(A1); Go to the second sheet, right click and select Rename and select
Copy and paste the second sheet name in A2. If I change the name of the
sheet, the macro looks for the old name of the sheet. So this doesn't
work

How can I automatically update A1, A2, etc with the name of the sheets
that I give in Excel?

Please help me find a formula (no VBA)!!

Thanks,

Ann


--
ann
------------------------------------------------------------------------
ann's Profile: http://www.excelforum.com/member.php...o&userid=17129
View this thread: http://www.excelforum.com/showthread...hreadid=554347



  #7   Report Post  
Posted to microsoft.public.excel.misc
mudraker
 
Posts: n/a
Default sheets


Anne

I see Dave has posted a formula for you

To fix up the error in my code

Range("a1").Value = wS.Name - This puts the name in A1 of the active
sheet

should be
wS.Range("a1").Value = wS.Name
This puts the sheet name in A1 of each sheet


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=554347

  #8   Report Post  
Posted to microsoft.public.excel.misc
ann
 
Posts: n/a
Default sheets


Thank you so much!!

This formula works:

=MID(CELL("filename",'Sheet 2'!A1),
FIND("]",CELL("filename",'Sheet 2'!A1))+1,255

Ann


--
ann
------------------------------------------------------------------------
ann's Profile: http://www.excelforum.com/member.php...o&userid=17129
View this thread: http://www.excelforum.com/showthread...hreadid=554347

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
insert Rows with Formulas in Place on Multiple Sheets? Michael Link Excel Discussion (Misc queries) 5 March 9th 06 01:54 PM
Macros-creating new sheets Bonbon Excel Worksheet Functions 3 February 17th 06 09:44 AM
Autofilter Lists across Multiple Sheets, Maintain Correct Referenc EDSTAFF Excel Worksheet Functions 0 November 14th 05 03:27 PM
In 3 active sheets in wkbk, determine& display the # of sheets that have data wrpalmer Excel Discussion (Misc queries) 1 November 4th 05 02:01 PM
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) RICHARD Excel Worksheet Functions 1 March 15th 05 05:49 PM


All times are GMT +1. The time now is 08:37 AM.

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"