Vlookup to a local file using macro

Moallem84

New Member
Joined
Aug 5, 2017
Messages
1
Hello,
My manager asked me to prepare a margin calculation sheet that contains confidential unit costs and limit its distribution to senior management only.

The idea is to create an excel file where the cost is read via a Vlookup formula reading for a local file in drive C.
So when a senior manager sends the file to a normal employee for example, this normal employee will open the file, see the price but never sees the cost or margin because they simply don't have the cost file saved in their drive C.

I tried doing so but creating a MACRO that reads from a local file, it worked, but then I sent it to my colleague for testing, and unfortunately the cost appeared in his version although he doesn't have the cost file.

The weird part here is that the formula in his excel version is shown as if reading from his local file that didn't really exist:

=IF(E4="EUR",IFERROR(VLOOKUP(B15,'C:\SC\[Cost_eff_2017USD.xlsx]Sheet1'!$A:$D,3,FALSE),0),IFERROR(VLOOKUP(B15,'C:\SC\[Cost_eff_2017USD.xlsx]Sheet1'!$A:$D,4,FALSE),0))

My question is, how can I amend this Macro in a way that whenever it's sent to someone who doesn't have the cost file saved in his drive C, he will simply get the cost and margin columns empty..

Appreciate your help!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,223,983
Messages
6,175,779
Members
452,668
Latest member
mrider123

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