MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 8th, 2002, 02:03 PM   #1
frissylea
New Member
 
Join Date: Apr 2002
Location: Oklahoma
Posts: 4
Default

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.


frissylea is offline   Reply With Quote
Old Apr 8th, 2002, 02:07 PM   #2
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,
LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))
__________________
~Anne Troy
Anne Troy is offline   Reply With Quote
Old Apr 8th, 2002, 02:14 PM   #3
frissylea
New Member
 
Join Date: Apr 2002
Location: Oklahoma
Posts: 4
Default

Quote:
On 2002-04-08 13:07, Dreamboat wrote:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,
LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))
how do i apply this code.. do i just cut and paste into the cell i want it in?? I do have some knowlege on macros.. but not in excell.. I am familure with macros in WordPerfect only..

frissylea is offline   Reply With Quote
Old Apr 9th, 2002, 01:08 PM   #4
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

Quote:
On 2002-04-08 13:14, frissylea wrote:
Quote:
On 2002-04-08 13:07, Dreamboat wrote:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,
LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))
how do i apply this code.. do i just cut and paste into the cell i want it in?? I do have some knowlege on macros.. but not in excell.. I am familure with macros in WordPerfect only..

Chris,

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 ::
Chris Davison is offline   Reply With Quote
Old Apr 10th, 2002, 05:42 AM   #5
frissylea
New Member
 
Join Date: Apr 2002
Location: Oklahoma
Posts: 4
Default

Hi Chris,
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
I tried just pasting into the cell... that didn't work. Maybe I am doing something wrong... all that printed out/or that could be seen in the cell was the code... In other words, the name of the Sheet did not replace the code.

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 ]
frissylea is offline   Reply With Quote
Old Apr 10th, 2002, 06:10 AM   #6
christal
New Member
 
Join Date: Apr 2002
Posts: 45
Default

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
christal is offline   Reply With Quote
Old Apr 10th, 2002, 06:32 AM   #7
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

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.


Dave Hawley is offline   Reply With Quote
Old Apr 10th, 2002, 07:24 AM   #8
frissylea
New Member
 
Join Date: Apr 2002
Location: Oklahoma
Posts: 4
Default

Quote:
On 2002-04-10 05:32, Dave Hawley wrote:
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.
I tried this, i get a Compile error/or sintax error...

I tried Crystal's way also, no luck... maybe it is just me... LOL


frissylea is offline   Reply With Quote
Old Apr 10th, 2002, 04:08 PM   #9
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

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
Chris Davison is offline   Reply With Quote
Old Apr 10th, 2002, 04:29 PM   #10
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

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"
Jack in the UK is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:29 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes