refer to cell within a formula

nparsons75

Well-known Member
Joined
Sep 23, 2013
Messages
1,256
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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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.


[TABLE="class: grid, width: 800"]
<tbody>[TR]
[TD]REF NO[/TD]
[TD]DATE[/TD]
[TD]PROJECT TITLE[/TD]
[TD]STATUS[/TD]
[TD]PROGRESS[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]17/9/17[/TD]
[TD]PROJECT 1[/TD]
[TD]ACTIVE[/TD]
[TD]55%[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]18/9/17[/TD]
[TD]PROJECT 2[/TD]
[TD]COMPLETE[/TD]
[TD]100%[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]19/9/17[/TD]
[TD]PROJECT 3[/TD]
[TD]ON HOLD[/TD]
[TD]0%[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]20/9/17[/TD]
[TD]PROJECT 4[/TD]
[TD]ACTIVE[/TD]
[TD]85%[/TD]
[/TR]
</tbody>[/TABLE]


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,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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