![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Oklahoma
Posts: 4
|
i am fairly new to excel, so need help with something that could be easy or maybe can't be done. I want to have the name of the Worksheet (i.e. July 2001) appear in a cell at the top of the document. This workbook has a sheet for each month in a year, each time i copy a sheet to create a new month, I have to change the name of the sheet then make a change to a cell at the top of the document with the same text. Is it possible to set up a macro or something that would read what the sheet name is and insert it into the same shell in every sheet in a workbook??
I hope this is not a dumb question... but am trying to save time have to type this text twice for each sheet. |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
|
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,
LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))
__________________
~Anne Troy |
|
|
|
|
|
#3 | |
|
New Member
Join Date: Apr 2002
Location: Oklahoma
Posts: 4
|
Quote:
|
|
|
|
|
|
|
#4 | ||
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Quote:
just type it into the cell you want your sheet tab reference to appear or copy the formula and paste special as unicode text
__________________
:: Pharma Z - Family drugstore :: |
||
|
|
|
|
|
#5 | |
|
New Member
Join Date: Apr 2002
Location: Oklahoma
Posts: 4
|
Hi Chris,
Quote:
I wonder if there is something missing in it. In my excel file, I am using columns A-F and rows 1-38... in row 3, I have merged all the columns together so there is one long cell. Inside this cell I want to duplicate the name of the sheet. Each sheet in the document will be titled with the Month and the Year (July 2001) which represents the month/year that statistics were taken. All I want to do is repeat the name of the sheet (july 2001) into Cell Row 3 of each sheet. Is the code correct for what I want to do. Thanks for any help. _________________ Chris [ This Message was edited by: frissylea on 2002-04-10 04:43 ] |
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Apr 2002
Posts: 45
|
Hi Chris....
I may have figured out the problem... I too tried the same function and it didn't work! It displayed as text in the cell. Copy and paste in the appropriate cell, what was given to you by Dreamboat and then make sure you put and = before the formula. Make sure you have only one = before the value. Hope this helps! Christal |
|
|
|
|
|
#7 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Chris
There is potential problem with the CELL function, in that you must force a re-calulation to get the active sheet name. I use a very simple UDF for this: Code:
Function SheetName(AnyCell As Range)
SheetName = AnyCell.Parent.Name
End Function
To use this, simply Hold down the Alt key, Push F11, go to Insert>Module and paste in the Code. Then click the top right X to get back into Excel and Save. Now in any cell put =SheetName(F4) Where F4 is any cell on the sheet. |
|
|
|
|
|
#8 | |
|
New Member
Join Date: Apr 2002
Location: Oklahoma
Posts: 4
|
Quote:
I tried Crystal's way also, no luck... maybe it is just me... LOL |
|
|
|
|
|
|
#9 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Dreamboats entry sometimes produces a leading space at the front and a space in the middle.... try deleting both or just type it in as seen on screen, it shoud work
|
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
Chris
the reason this occurs is the formula is not custom or fresh its copied fro where ever, database or web page it dont matter so paste into dhtml MEANS SPACE ! no way to avoid, bar manul abck up a cell after paste (Ctrl+V) also can tell by the lay out they are to tidy and mirrored.. Hope that makes sence.. the contence is excellent thou i add and work perfect once you jig them Rdgs you friend. Jack in the UK
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|