Replace link with current directory path

purplereine

New Member
Joined
Sep 18, 2014
Messages
1
Excel 2013

Hi, I'm trying to create a data gatherer template; so it's like a master file that users can just copy and save in a different folder where the rest of the files where the data will be pulled from will be saved.

What I need to have the VBA do is replace all the default links within the data gatherer to the directory where the files are saved when the user opens the file.
This is an example of a link that I currently have in the data gatherer; I'll need this portion
'C:\Users\purplereine\Desktop\Calibrations\01 September\Week_of_Sep_08\
to change to the current directory

=IFERROR(IF('C:\Users\purplereine\Desktop\Calibrations\01 September\Week_of_Sep_08\[01.xlsm]Breakdown'!$H$4="","",'C:\Users\purplereine\Desktop\Calibrations\01 September\Week_of_Sep_08\[01.xlsm]Breakdown'!$H$4),"")
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Watch MrExcel Video

Forum statistics

Threads
1,112,818
Messages
5,542,677
Members
410,568
Latest member
jmagasan
Top