Using Lookups within VBA Code?

Whitieklf

New Member
Joined
Dec 4, 2009
Messages
12
IN VBA I use the following command to navigate to a network drive and open a specific file.

Code:
Workbooks.Open Filename:= _
        "\\ Network\Address\Folder\Filename.xlsm", Password:="ABC"
In Cell K3 of Sheet1 I have a formula that fills in the username of the person opening the spreadsheet (this is a unique value).

Is there any way to use this username to open a specific file dependent on who opens it?

IE

\\ Network\Address\Folder\(Contents of Sheet1 K3).xlsm

Hope this makes sense.

Paul
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try

Code:
Workbooks.Open Filename:= _
        "\\ Network\Address\Folder\" & Sheets("Sheet1").Range("K3").Value & ".xlsm", Password:="ABC"
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

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