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 May 9th, 2002, 12:10 AM   #1
Peter100
Board Regular
 
Join Date: Apr 2002
Posts: 758
Default

I have a workbook named Master.xls which is a master template.
I have workbooks for each month named JanData.xls - Dec.xls

I want to link the data from cell A1 in JanData.xls into cell A1 of
Master.xls which is simple enough.

The link would look like ='[JanData.xls]Sheet1'!$A$1

But what I want to be able to do is replace the [JanData.xls] part of the link
with a cell reference in Master.xls which would be a text entry so that the link
could be changed to read from FebData.xls - MarData.xls etc as desired.

Anyone any Ideas ?

Peter100 is offline   Reply With Quote
Old May 9th, 2002, 03:34 AM   #2
philR
Board Regular
 
Join Date: Feb 2002
Location: Sheffield, UK
Posts: 249
Default

OK, suppose the cell B2 contains the text:

'FebData.xls

(note the single quote so Excel recognises it as text) Then you can use this formula:

=INDIRECT(CONCATENATE("[",B2,"]Sheet1!$A$1"))



[ This Message was edited by: philR on 2002-05-09 02:37 ]
philR is offline   Reply With Quote
Old May 9th, 2002, 05:58 AM   #3
Peter100
Board Regular
 
Join Date: Apr 2002
Posts: 758
Default

Sorry Phil

Can' make that one work

I'm using Excel 97 does that make any difference

[ This Message was edited by: Peter100 on 2002-05-09 04:58 ]
Peter100 is offline   Reply With Quote
Old May 9th, 2002, 06:14 AM   #4
Peter100
Board Regular
 
Join Date: Apr 2002
Posts: 758
Default

Phil
Sorry about Sorry
Tried it again and it worked

Thanks very much
Peter100 is offline   Reply With Quote
Old May 9th, 2002, 06:20 AM   #5
philR
Board Regular
 
Join Date: Feb 2002
Location: Sheffield, UK
Posts: 249
Default

I should have added: This will only work if you have the FebData.xls spreadsheet open at the time. For some reason, I am having difficulty getting it to do it when FebData.xls is closed, although I know it can be done. You basically have to include the pathname in the concatenate statement. Or, if there is a possibility that some of the sheets will be in different directories, include the pathname in B2 instead, and get rid of the square brackets in the concatenate statement. However, you need some single quotes in there somewhere as well, and I can't quite get it to work at the mo. I will keep trying. Let me kno if you solve it first.
philR is offline   Reply With Quote
Old May 9th, 2002, 06:43 AM   #6
Peter100
Board Regular
 
Join Date: Apr 2002
Posts: 758
Default

Hi Phil
I was just going to reply saying exactly what youv'e said "BOTH BOOKS HAVE TO BE OPEN"

which is a bit of a snag along with it appears that they have to reside in the default Excel save directory.

I'll keep working on it but if you come up with an answer PLEASE let me know.
Peter100 is offline   Reply With Quote
Old May 9th, 2002, 07:10 AM   #7
EBK
New Member
 
Join Date: Apr 2002
Location: Paul, Sydney Australia
Posts: 10
Default

Could you explain the overall concept of the master file. Do you want the cell with jan.xls info replaced with the cell from feb.xls info, or do you want to keep jan info in master.xls and bring feb.xls info into seperate cells?


Paul

EBK is offline   Reply With Quote
Old May 9th, 2002, 08:42 AM   #8
Peter100
Board Regular
 
Join Date: Apr 2002
Posts: 758
Default

I have a master sheet for each month that contains 31 sheets (one for each day of the month) each sheet contains approx 200 data cells.

Sepearately, someone produces each month a data file containing all the data information in identical format.I then in the master do many calculations and graphs related to it.

What I want to do is bring in the relevant months data into all 31 sheets by simply changing the text entry from JanData.xls to FebData.xls

There is no real problem with the relevant months data file having to be open although it would be nice.

The bigger problem I see is that the formula will not copy and paste relatively and I am going to have to amend each cell manually (I can you search and replace to an extent)

what would, onthinking about it be better was if each sheet could link directly to the relevant data sheet in its entirety (they are identical)

Any further Ideas ?

[ This Message was edited by: Peter100 on 2002-05-09 07:44 ]
Peter100 is offline   Reply With Quote
Old May 10th, 2002, 08:48 PM   #9
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

=INDIRECT("["&$A$1&"data.xls]Sheet1!"&ADDRESS(1,COLUMN(A:A),4,1))

this may help if you have "jan" "feb" etc as your cells to refer to in A1

ADDRESS(1 points it to destination row 1
COLUMN a:a RETURNS "1" AND IS TRANSLATED TO A, assuming your first destination column is A..... just change these two appropriately

ie if your first bit of info sits in G7, change it to

&ADDRESS(7,COLUMN(G:G),4,1)

this should then copy over and down as needed

downsides :

1) you may notice recalc times shhot up because of the volatile functions

2) scource workbooks still need to be open for indirect to work
__________________
:: Pharma Z - Family drugstore ::
Chris Davison is offline   Reply With Quote
Old May 10th, 2002, 09:37 PM   #10
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-05-08 23:10, Peter100 wrote:
I have a workbook named Master.xls which is a master template.
I have workbooks for each month named JanData.xls - Dec.xls

I want to link the data from cell A1 in JanData.xls into cell A1 of
Master.xls which is simple enough.

The link would look like ='[JanData.xls]Sheet1'!$A$1

But what I want to be able to do is replace the [JanData.xls] part of the link
with a cell reference in Master.xls which would be a text entry so that the link
could be changed to read from FebData.xls - MarData.xls etc as desired.

Anyone any Ideas ?

I used the HYPERLINK function ...

path name in cell A1
File name with extension in cell B1
sheet name and cell name in cell c1

Then use the following formula for hyperlink ...

=HYPERLINK(A1&B1,C1)

This will work even when you change any of the entries in cells A1 B1,or C1 and even if the workbooks are closed.

please post back if it works for you ... otherwise explain a little further and let us take it from there.

Regards!


__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand 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:49 PM.


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