Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Misssy
 
Posts: n/a
Default Dynamic reference to workbook

I have some formulas and need an easy way to switch workbooks but keep the
same cell reference on the different workbooks. Example
first run 'C:\dir\[day1].sheet1'!A1
second run 'C:\dir\[day2].sheet1'!A1
thrid run 'C:\dir\[day2].sheet1'!A1

How could I change between workbook day1, day2 or day3 without doing a
search and replace?

Also, the formulas are more complicated than my example, there may be 4 or 5
workbook references within a formula. I tried using TEXT and letting the
text reference hold the changing workbook, but don't see how to make this
work when there are so many places it would have to be.

Here is a real example - and next time I run I would need workbook
[elast.xls] to be [elast1.xls]

=+Solver!$A$61-shocks!$H$6-shocks!$H$50-'C:\Dir\[elast.xls]Sheet1'!$C$12*Solver!$A$63-'C:\Dir\[elast.xls]Sheet1'!$D$12*Solver!$A$64-'C:\Dir\[elast.xls]Sheet1'!$E$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$F$12*Solver!$A$66-'C:\Dir\[elast.xls]Sheet1'!$G$12*Solver!$A$70-'C:\Dir\[elast.xls]Sheet1'!$H$12*Solver!$A$69-'C:\Dir\[elast.xls]Sheet1'!$I$12*Solver!$A$72-'C:\Dir\[elast.xls]Sheet1'!$J$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$K$12*Solver!$A$71-'C:\Dir\[elast.xls]Sheet1'!$L$12*Solver!$A$67
  #2   Report Post  
bj
 
Posts: n/a
Default

concider something like the indirect function
in column A place your day1,day2, etc
in column B
=indirect("'C:\dir\["&A1&"].sheet1'!$A$1")


"Misssy" wrote:

I have some formulas and need an easy way to switch workbooks but keep the
same cell reference on the different workbooks. Example
first run 'C:\dir\[day1].sheet1'!A1
second run 'C:\dir\[day2].sheet1'!A1
thrid run 'C:\dir\[day2].sheet1'!A1

How could I change between workbook day1, day2 or day3 without doing a
search and replace?

Also, the formulas are more complicated than my example, there may be 4 or 5
workbook references within a formula. I tried using TEXT and letting the
text reference hold the changing workbook, but don't see how to make this
work when there are so many places it would have to be.

Here is a real example - and next time I run I would need workbook
[elast.xls] to be [elast1.xls]

=+Solver!$A$61-shocks!$H$6-shocks!$H$50-'C:\Dir\[elast.xls]Sheet1'!$C$12*Solver!$A$63-'C:\Dir\[elast.xls]Sheet1'!$D$12*Solver!$A$64-'C:\Dir\[elast.xls]Sheet1'!$E$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$F$12*Solver!$A$66-'C:\Dir\[elast.xls]Sheet1'!$G$12*Solver!$A$70-'C:\Dir\[elast.xls]Sheet1'!$H$12*Solver!$A$69-'C:\Dir\[elast.xls]Sheet1'!$I$12*Solver!$A$72-'C:\Dir\[elast.xls]Sheet1'!$J$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$K$12*Solver!$A$71-'C:\Dir\[elast.xls]Sheet1'!$L$12*Solver!$A$67

  #3   Report Post  
Misssy
 
Posts: n/a
Default

I considered this also, when I get to the second one how would it look? like
this?

=indirect("'C:\dir\["&A1&"].sheet1'!$A$1") -
indirect("'C:\dir\["&B1&"].sheet1'!$A$1") -
indirect("'C:\dir\["&C1&"].sheet1'!$A$1")

"bj" wrote:

concider something like the indirect function
in column A place your day1,day2, etc
in column B
=indirect("'C:\dir\["&A1&"].sheet1'!$A$1")


"Misssy" wrote:

I have some formulas and need an easy way to switch workbooks but keep the
same cell reference on the different workbooks. Example
first run 'C:\dir\[day1].sheet1'!A1
second run 'C:\dir\[day2].sheet1'!A1
thrid run 'C:\dir\[day2].sheet1'!A1

How could I change between workbook day1, day2 or day3 without doing a
search and replace?

Also, the formulas are more complicated than my example, there may be 4 or 5
workbook references within a formula. I tried using TEXT and letting the
text reference hold the changing workbook, but don't see how to make this
work when there are so many places it would have to be.

Here is a real example - and next time I run I would need workbook
[elast.xls] to be [elast1.xls]

=+Solver!$A$61-shocks!$H$6-shocks!$H$50-'C:\Dir\[elast.xls]Sheet1'!$C$12*Solver!$A$63-'C:\Dir\[elast.xls]Sheet1'!$D$12*Solver!$A$64-'C:\Dir\[elast.xls]Sheet1'!$E$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$F$12*Solver!$A$66-'C:\Dir\[elast.xls]Sheet1'!$G$12*Solver!$A$70-'C:\Dir\[elast.xls]Sheet1'!$H$12*Solver!$A$69-'C:\Dir\[elast.xls]Sheet1'!$I$12*Solver!$A$72-'C:\Dir\[elast.xls]Sheet1'!$J$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$K$12*Solver!$A$71-'C:\Dir\[elast.xls]Sheet1'!$L$12*Solver!$A$67

  #4   Report Post  
Misssy
 
Posts: n/a
Default

OK, I figured out how to do math with 2 indirects, but can't seem to get my
indirect to a dynamic workbook to work

I have this cell reference that works and returns the correct value
='E:\EcoModel\[CallingA.xls]A'!$A$1

I try to wrap the indirect around it as in the example bj gave, and it
doesn't recognize the cell reference
A1 = CallingA.xls
=INDIRECT("'E:\ecomodel\["&A1&"]A'!$A$1")

My quotes match, and I removed the . since I didn't see it in any other
examples I can find.



"Misssy" wrote:

I considered this also, when I get to the second one how would it look? like
this?

=indirect("'C:\dir\["&A1&"].sheet1'!$A$1") -
indirect("'C:\dir\["&B1&"].sheet1'!$A$1") -
indirect("'C:\dir\["&C1&"].sheet1'!$A$1")

"bj" wrote:

concider something like the indirect function
in column A place your day1,day2, etc
in column B
=indirect("'C:\dir\["&A1&"].sheet1'!$A$1")


"Misssy" wrote:

I have some formulas and need an easy way to switch workbooks but keep the
same cell reference on the different workbooks. Example
first run 'C:\dir\[day1].sheet1'!A1
second run 'C:\dir\[day2].sheet1'!A1
thrid run 'C:\dir\[day2].sheet1'!A1

How could I change between workbook day1, day2 or day3 without doing a
search and replace?

Also, the formulas are more complicated than my example, there may be 4 or 5
workbook references within a formula. I tried using TEXT and letting the
text reference hold the changing workbook, but don't see how to make this
work when there are so many places it would have to be.

Here is a real example - and next time I run I would need workbook
[elast.xls] to be [elast1.xls]

=+Solver!$A$61-shocks!$H$6-shocks!$H$50-'C:\Dir\[elast.xls]Sheet1'!$C$12*Solver!$A$63-'C:\Dir\[elast.xls]Sheet1'!$D$12*Solver!$A$64-'C:\Dir\[elast.xls]Sheet1'!$E$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$F$12*Solver!$A$66-'C:\Dir\[elast.xls]Sheet1'!$G$12*Solver!$A$70-'C:\Dir\[elast.xls]Sheet1'!$H$12*Solver!$A$69-'C:\Dir\[elast.xls]Sheet1'!$I$12*Solver!$A$72-'C:\Dir\[elast.xls]Sheet1'!$J$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$K$12*Solver!$A$71-'C:\Dir\[elast.xls]Sheet1'!$L$12*Solver!$A$67

  #5   Report Post  
bj
 
Posts: n/a
Default

I don't know if it makes any difference, but the capital structure in the
working equaiton and the non working equation are different.
for the equation that works
='E:\EcoModel\[CallingA.xls]A'!$A$1
try
=indirect("'E:\EcoModel\[CallingA.xls]A'!$A$1")
I have also had them work by adding or deleting the ".xls"
I have no clue why.

"Misssy" wrote:

OK, I figured out how to do math with 2 indirects, but can't seem to get my
indirect to a dynamic workbook to work

I have this cell reference that works and returns the correct value
='E:\EcoModel\[CallingA.xls]A'!$A$1

I try to wrap the indirect around it as in the example bj gave, and it
doesn't recognize the cell reference
A1 = CallingA.xls
=INDIRECT("'E:\ecomodel\["&A1&"]A'!$A$1")

My quotes match, and I removed the . since I didn't see it in any other
examples I can find.



"Misssy" wrote:

I considered this also, when I get to the second one how would it look? like
this?

=indirect("'C:\dir\["&A1&"].sheet1'!$A$1") -
indirect("'C:\dir\["&B1&"].sheet1'!$A$1") -
indirect("'C:\dir\["&C1&"].sheet1'!$A$1")

"bj" wrote:

concider something like the indirect function
in column A place your day1,day2, etc
in column B
=indirect("'C:\dir\["&A1&"].sheet1'!$A$1")


"Misssy" wrote:

I have some formulas and need an easy way to switch workbooks but keep the
same cell reference on the different workbooks. Example
first run 'C:\dir\[day1].sheet1'!A1
second run 'C:\dir\[day2].sheet1'!A1
thrid run 'C:\dir\[day2].sheet1'!A1

How could I change between workbook day1, day2 or day3 without doing a
search and replace?

Also, the formulas are more complicated than my example, there may be 4 or 5
workbook references within a formula. I tried using TEXT and letting the
text reference hold the changing workbook, but don't see how to make this
work when there are so many places it would have to be.

Here is a real example - and next time I run I would need workbook
[elast.xls] to be [elast1.xls]

=+Solver!$A$61-shocks!$H$6-shocks!$H$50-'C:\Dir\[elast.xls]Sheet1'!$C$12*Solver!$A$63-'C:\Dir\[elast.xls]Sheet1'!$D$12*Solver!$A$64-'C:\Dir\[elast.xls]Sheet1'!$E$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$F$12*Solver!$A$66-'C:\Dir\[elast.xls]Sheet1'!$G$12*Solver!$A$70-'C:\Dir\[elast.xls]Sheet1'!$H$12*Solver!$A$69-'C:\Dir\[elast.xls]Sheet1'!$I$12*Solver!$A$72-'C:\Dir\[elast.xls]Sheet1'!$J$12*Solver!$A$68-'C:\Dir\[elast.xls]Sheet1'!$K$12*Solver!$A$71-'C:\Dir\[elast.xls]Sheet1'!$L$12*Solver!$A$67

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
Help to import data from reference workbook JackSpam Excel Discussion (Misc queries) 2 July 20th 05 02:37 AM
Dynamic Function Reference Question excel newbie Excel Discussion (Misc queries) 1 April 20th 05 08:09 PM
Excel: Use a name with external workbook reference for data valida Fishyken Excel Worksheet Functions 3 March 11th 05 10:24 PM
dynamic external cell reference bg.itdept Excel Worksheet Functions 4 February 19th 05 03:15 AM
Change workbook sheet reference using cell A1 to change a vairable Reed Excel Worksheet Functions 4 January 20th 05 07:15 PM


All times are GMT +1. The time now is 07:57 AM.

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

About Us

"It's about Microsoft Excel"