Replace part of file name in a formula based on sheet name

Jenkins87

New Member
Joined
Jun 4, 2014
Messages
7
I'm really hoping someone could help me out with this one. Here is my situation: I have a workbook with several sheets, all set up exactly the same. Each cell on a sheet is referencing the same file, however each sheet is referencing a different file.

For example, this is one of the cells in a sheet:

=IF(ISNA(VLOOKUP("iso1r2",'E:\BAM4\Tests\AnalysisChkA1\[B3LE1.xls]Dat'!$A$2:$CO$24,COLUMN(F2),FALSE)),"",VLOOKUP("iso1r2",'E:\BAM4\Tests\AnalysisChkA1\[B3LE1.xls]Dat'!$A$2:$CO$24,COLUMN(F2),FALSE))

And I would like the B3 to automatically be replaced with the sheet name in all cells.

Is there a function I can add into this formula, or would it be easy to create a VBA code (I currently do know how to write code)?
 

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.
Thanks Jack! I've tried using the indirect function and can't seem to get it to work for this purpose. Any other ideas?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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