How to change Excel links in bulk by recognizing file name

%3CLINGO-SUB%20id%3D%22lingo-sub-2511940%22%20slang%3D%22en-US%22%3EHow%20to%20change%20Excel%20links%20in%20bulk%20by%20recognizing%20file%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2511940%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20Team%2C%3C%2FP%3E%3CP%3EI%20am%20now%20preparing%20monthly%20budget-forecast%20review%20workbook%20%22Jan%20forecast.xls%22%20(Destination%20workbook).%3C%2FP%3E%3CP%3EIn%20order%20to%20prepare%20this%2C%20I%20will%20use%20numbers%20linked%20to%20several%20workbooks%20%22Jan%20exp.xls%22%2C%20%22Jan%20cost.xls%22%20(source%20workbooks)%20provided%20on%20a%20monthly%20basis.%3C%2FP%3E%3CP%3ESince%20there%20are%2030%2B%20links%20in%20%22Jan%20forecast.xls%22%20(Destination%20workbook)%20and%20I'd%20like%20to%20maintain%20the%20formulas%20based%20on%20the%20current%20destination%20workbook%20but%20only%20update%20the%20links%20for%20next%20month's%20source%20numbers.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20to%20seek%20any%20kind%20advice%2Fmethods%20to%20update%20the%20source%20links%20according%20to%20the%20file%20name%20(from%22Jan%20exp.xls%22%20to%20%22Feb%20exp.xls%22%2F%20from%22Jan%20cost.xls%22%20to%20%22Feb%20cost.xls%22...)%20automatically%20by%20using%20macro%20on%20a%20monthly%20basis%20instead%20of%20manually%20changing%20the%2030%2B%20links%20via%26nbsp%3B%3CSPAN%3EData-%26gt%3B%20Edit%20Links%20function%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2511940%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2513311%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20change%20Excel%20links%20in%20bulk%20by%20recognizing%20file%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2513311%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1094367%22%20target%3D%22_blank%22%3E%40AngeloRussel%3C%2FA%3E%26nbsp%3BHave%20you%20tried%20Excell's%20built-in%20tool%20%22Find%20and%20Replace%22%20option%2C%20%26nbsp%3BCtrl-H%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFill%20in%20%3CSTRONG%3EJan%20exp%20%3C%2FSTRONG%3Ein%26nbsp%3Bthe%20%3CEM%3EFind%20what%3A%3C%2FEM%3E%20field%3C%2FP%3E%3CP%3EFill%20in%20%3CSTRONG%3EFeb%20exp%20%3C%2FSTRONG%3Ein%26nbsp%3Bthe%20%3CEM%3EReplace%20with%3A%3C%2FEM%3E%20field%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERepeat%20this%20for%20the%20other%20file%20names%20in%20your%20links.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnder%20%3CEM%3EOptons%20%3C%2FEM%3Etell%20it%20to%26nbsp%3Bapply%20the%20find%20%26amp%3B%20replace%20to%20the%20entire%20workbook.%20That%20should%20do%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Dear Team,

I am now preparing monthly budget-forecast review workbook "Jan forecast.xls" (Destination workbook).

In order to prepare this, I will use numbers linked to several workbooks "Jan exp.xls", "Jan cost.xls" (source workbooks) provided on a monthly basis.

Since there are 30+ links in "Jan forecast.xls" (Destination workbook) and I'd like to maintain the formulas based on the current destination workbook but only update the links for next month's source numbers.

 

This is to seek any kind advice/methods to update the source links according to the file name (from"Jan exp.xls" to "Feb exp.xls"/ from"Jan cost.xls" to "Feb cost.xls"...) automatically by using macro on a monthly basis instead of manually changing the 30+ links via Data-> Edit Links function?

3 Replies

@AngeloRussel Have you tried Excell's built-in tool "Find and Replace" option,  Ctrl-H? 

 

Fill in Jan exp in the Find what: field

Fill in Feb exp in the Replace with: field

 

Repeat this for the other file names in your links.

 

Under Optons tell it to apply the find & replace to the entire workbook. That should do it.

@Riny_van_Eekelen Hi Riny, thank you for the response! Yes, I've tried the "Find and Replace" option but since the file name (ex. Jan exp) is also in the spreadsheets but I dont want to update it to Feb exp. Thus, this is to seek if there's any other tools/ methods can update the links in a batch (ex. replace bunch of old links to new links) instead of using the Data->Edit link method? thank you. 

@AngeloRussel Would it work if you use Jan exp.xlsx ?

 

Or, if your sheet contains a cell with a text like, "Jan expenses", consider entering "Expenses January" in stead. Just so that the actual file names used in the links are not used as a text in the sheet as well.