refer to cell within a formula

nparsons75

Well-known Member
Joined
Sep 23, 2013
Messages
1,254
Office Version
  1. 2016
Hi,

I use this formula to create a hyperlink to a file stored in the location stated within the formula.

='\\file\projects\BUSINESS IMPROVEMENT\BUSINESS IMPROVEMENT STORAGE\32\PROJECT CONTROL\[32.xlsm]CONTROL REGISTER'!$B$13

The number 32 in this case (in red) has to be added manually. However the number exists in a cell adjacent (in column A) to the cell that contains the formula. Is it possible to refer automatically to this number within the formula so links are created automatically?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
assuming in cell A2
try
indirect("'\\file\projects\BUSINESS IMPROVEMENT\BUSINESS IMPROVEMENT STORAGE"&A2&"\PROJECT CONTROL\["&A2&".xlsm]CONTROL REGISTER'!$B$13")

 
Upvote 0
Hi Wayne, good to hear from you. I just tried it as you suggested but get #REF ?

My table consists of a lot of rows, each row in column A has a reference number, this is the number I need to link to.


REF NODATEPROJECT TITLESTATUSPROGRESS
117/9/17PROJECT 1ACTIVE55%
218/9/17PROJECT 2COMPLETE100%
319/9/17PROJECT 3ON HOLD0%
420/9/17PROJECT 4ACTIVE85%

<tbody>
</tbody>


For each of the rows I have an excel file that I name the same as the ref number. (1.xlms) for example. I need each reference number to link to each file automatically. This will mean a user can click on the ref no to open up the file. Each time I add a new row I need the ref no to create a link automatically.

I need the same also for progress. The value for progress is taken from a value located on the excel sheet named (1.xlms). Therefore, I need the column PROGRESS to look at the sheet (1.xmls) and return the value into the progress box.

Really hope that makes some kind of sense....
 
Upvote 0
Upvote 0
As suggested above, INDIRECT() doesn't work for closed workbooks. I think you have two options, both of which will require VBA:

Option 1: Use VBA to set the correct formula in column E based on the value in column A.
Option 2: Use a UDF in VBA to go and get the value from the closed workbook and put it in column E.

WBD
 
Upvote 0

Forum statistics

Threads
1,215,388
Messages
6,124,648
Members
449,177
Latest member
Sousanna Aristiadou

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top