Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I alter a link in excel depending upon a cell value

Posted on 2013-01-29
7
Medium Priority
?
281 Views
Last Modified: 2013-02-04
Hi,

I have a link that works fine:
='K:\Accounts\[1.xls]Sheet1'!F74

but I now want to change the referenced workbook based on a cell value...

I have tried:
='K:\Accounts\["&A1&".xls]Sheet1'!F74
but this returns #REF where A1 =1

Can you please advise? I am using Excel 2010

Many Thanks
0
Comment
Question by:martinibbo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 13

Assisted Solution

by:Shanan212
Shanan212 earned 400 total points
ID: 38832344
Your file 1.xls has to be open when you try this

try this

=indirect("'K:\Accounts\["&A1&".xls]Sheet1'!F74")
0
 

Author Comment

by:martinibbo
ID: 38832355
The file must be closed as I have many links....

Can we encorporate the index function somehow??

Thanks
0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 1600 total points
ID: 38832404
You might like to try the indirect.ext() function which works on closed files also. You would, however have to download and install the morefunc.xla addin for this
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:martinibbo
ID: 38834488
Briefly doing some research into morefunc.xla, there appears to be some compatability issues with Excel 2010 (upto 2007 supported) and some people experiencing the program to crash.

As multiple computers would be accessing this workbook - would I need to install the addin onto each computer?

Also can you recommend a "safe" website to download the addin from?

The link to:  http://www.get-digital-help.com/2010/05/12/extracting-unique-distinct-text-values-from-a-closed-workbook-in-excel-formula/ provides an interesting result close to what I want. Can this be adapted to suit my formula?

Many Thanks
0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 1600 total points
ID: 38834909
I have not tried this but this web page shows that the addin has to be installed on 2010 in a manner different from the way it is done on prior versions

http://www.ashishmathur.com/tag/indirect-ext/

See if it works for you.

As far as the link you provided is concerned the file reference is hardcoded in the formula and cannot be variable so cannot use that.
0
 

Accepted Solution

by:
martinibbo earned 0 total points
ID: 38835540
Thank you all for the quick responses - although I am sure that the excel addin would work, I have many PC's accessing the program and there would need to be over 1000 links. The statement on your last link:  "Since data is being extracted from closed Excel files via an addin, performance of the workbook will take a hit.  Please try this on limited Excel files first." therefore concerned me greatly.

If the scale of my program was smaller then I would of course try it, or if the linked excel workbook could be open at the same time the indirect formula would work - so thank you.

Instead I have chosen to go with a very simple VBA code to generate the links, similar to this:

a = ActiveCell.Value 'where "a" referenced a workbooks name (e.g.1-100)
ActiveCell.Offset(0,1).FormulaR1C1 = "='K:\Accounts\[" & a & ".xlsx]Sheet1'!R1C1"
'then loop through relevant "a" list of workbooks
 
Thanks again!
0
 

Author Closing Comment

by:martinibbo
ID: 38850432
Most suitable, without installing addins and without compromising performance
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question