SOLVED

How to Index Match from multiple closed workbooks in excel.

%3CLINGO-SUB%20id%3D%22lingo-sub-2680113%22%20slang%3D%22en-US%22%3EHow%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2680113%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20Tech%20Community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20reference%20multiple%20closed%20Excel%20workbooks%20with%20different%20file%20paths%20and%20file%20names.%20My%20initial%20approach%20was%20to%20define%20the%20file%20path%20and%20file%20name%20in%20different%20cells%20and%20concatenate%20it%20into%20the%20string%20with%20the%20relevant%20syntax%20(i.e%20putting%20square%20brackets%20around%20the%20file%20name%2C%20putting%20an%20exclamation%20point%20after%20the%20sheet%20etc.%5D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%20width%3D%22681px%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%22259.839px%22%3EA1%20-%20File%20Path%3C%2FTD%3E%3CTD%20width%3D%2282.9196px%22%3EB1%20-%20File%20Name%3C%2FTD%3E%3CTD%20width%3D%22147.241px%22%3EC1%20-%20Sheet%20Name%3C%2FTD%3E%3CTD%20width%3D%22149.991px%22%3ED1%20-%20Concatenated%20String%20Formula%3C%2FTD%3E%3CTD%20width%3D%2240.0089px%22%3EE1%20-Index%20Match%20Formula%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%22259.839px%22%3E%26nbsp%3BC%3A%5CUsers%5Cwadoodoo%5CDesktop%5CCash%20Flow%20Tools%5CMoney%5C%26nbsp%3B%3C%2FTD%3E%3CTD%20width%3D%2282.9196px%22%3E%26nbsp%3BSample%20Excel.xlsx%26nbsp%3B%3C%2FTD%3E%3CTD%20width%3D%22147.241px%22%3ESample%20Sheet%3C%2FTD%3E%3CTD%20width%3D%22149.991px%22%3E%3DCONCATENATE(%22'%22%20%26amp%3B%20A1%20%26amp%3B%20%22%5B%22%20%26amp%3B%20B1%20%26amp%3B%20%22%5D%22%20%26amp%3B%20C1%26amp%3B%20%22'%22)%3C%2FTD%3E%3CTD%20width%3D%2240.0089px%22%3E%3DINDEX('D1'!%24C%3A%24C%2CMATCH(G5%2C'D1'!%24B%3A%24B%2C0))%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%20this%20does%20not%20work.%20Every%20time%20I%20have%20to%20manually%20select%20the%20file%20which%20is%20really%20tedious%20as%20I%20have%20to%20do%20this%20across%2050%20different%20files%20and%20each%20row%20refers%20to%20a%20different%20closed%20workbook.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20I%20can%20make%20this%20process%20a%20bit%20more%20dynamic%20since%20all%20I%20want%20to%20do%20is%20change%20the%20file%20name%20and%20excel%20should%20be%20able%20to%20pick%20up%20all%20the%20relevant%20data%20from%20the%20new%20file%20automatically.%20Each%20file%20will%20have%20a%20new%20version%20on%20a%20bi-weekly%2Fmonthly%20basis.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELook%20forward%20to%20any%20guidance%20and%20advice.%20Thank%20you%20in%20advance.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2680113%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2680845%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2680845%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1136437%22%20target%3D%22_blank%22%3E%40Wadoodoo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou'd%20need%20the%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Findirect-function-474b3a3a-8a26-4f44-b491-92b6306fa261%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EINDIRECT%20function%3C%2FA%3E%20for%20this%2C%20but%20unfortunately%20this%20only%20works%20with%20references%20to%20other%20workbooks%20if%20they%20are%20open%2C%20not%20if%20they%20are%20closed...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2680847%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2680847%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3Bthank%20you%20for%20the%20prompt%20response%20and%20help.%20I%20have%20used%20the%20INDIRECT%20function%20already%20and%20have%20a%20worksheet%20linked%20with%20all%20the%20other%20worksheets%20using%20INDIRECT...I%20dont%20mind%20using%20some%20VBA%20code%20to%20get%20this%20done%20but%20I%20have%20no%20idea%20how%20to%20start.%20If%20you%20do%20know%20some%20VBA%20could%20you%20please%20guide%20me%20as%20to%20which%20code%20could%20execute%20this%20task%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2681008%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2681008%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1136437%22%20target%3D%22_blank%22%3E%40Wadoodoo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETry%20this%3A%3C%2FP%3E%0A%3CP%3ERight-click%20the%20sheet%20tab.%3C%2FP%3E%0A%3CP%3ESelect%20%3CSTRONG%3EView%20Code%3C%2FSTRONG%3E%20from%20the%20context%20menu.%3C%2FP%3E%0A%3CP%3ECopy%20the%20following%20code%20into%20the%20worksheet%20module%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-visual-basic%22%3E%3CCODE%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%0A%20%20%20%20Dim%20rng%20As%20Range%0A%20%20%20%20Dim%20r%20As%20Long%0A%20%20%20%20Dim%20s%20As%20String%0A%20%20%20%20Dim%20f%20As%20String%0A%20%20%20%20On%20Error%20GoTo%20ErrHandler%0A%20%20%20%20If%20Not%20Intersect(Range(%22A1%3AC50%22)%2C%20Target)%20Is%20Nothing%20Then%0A%20%20%20%20%20%20%20%20Application.ScreenUpdating%20%3D%20False%0A%20%20%20%20%20%20%20%20Application.EnableEvents%20%3D%20False%0A%20%20%20%20%20%20%20%20For%20Each%20rng%20In%20Intersect(Range(%22A1%3AC50%22)%2C%20Target).Rows%0A%20%20%20%20%20%20%20%20%20%20%20%20r%20%3D%20rng.Row%0A%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20%22'%22%20%26amp%3B%20Range(%22A%22%20%26amp%3B%20r).Value%20%26amp%3B%20%22%5B%22%20%26amp%3B%20Range(%22B%22%20%26amp%3B%20r).Value%20%26amp%3B%20%22%5D%22%20%26amp%3B%20Range(%22C%22%20%26amp%3B%20r).Value%20%26amp%3B%20%22'!%22%0A%20%20%20%20%20%20%20%20%20%20%20%20f%20%3D%20%22%3DINDEX(%22%20%26amp%3B%20s%20%26amp%3B%20%22%24C%3A%24C%2CMATCH(G4%2C%22%20%26amp%3B%20s%20%26amp%3B%20%22%24B%3A%24B%2C0))%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Range(%22E%22%20%26amp%3B%20r).Formula%20%3D%20f%0A%20%20%20%20%20%20%20%20Next%20rng%0A%20%20%20%20End%20If%0AExitHandler%3A%0A%20%20%20%20Application.EnableEvents%20%3D%20True%0A%20%20%20%20Application.ScreenUpdating%20%3D%20True%0A%20%20%20%20Exit%20Sub%0AErrHandler%3A%0A%20%20%20%20MsgBox%20Err.Description%2C%20vbExclamation%0A%20%20%20%20Resume%20ExitHandler%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3ESwitch%20back%20to%20Excel.%3C%2FP%3E%0A%3CP%3ESave%20the%20workbook%20as%20a%20macro-enabled%20workbook%20(.xlsm).%3C%2FP%3E%0A%3CP%3EMake%20sure%20that%20you%20allow%20macros%20when%20you%20open%20the%20workbook.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2681061%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2681061%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1136437%22%20target%3D%22_blank%22%3E%40Wadoodoo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20creating%20the%20code%20as%20described%20in%20my%20previous%20reply%20and%20switching%20back%20to%20Excel%2C%20press%20F12%20to%20activate%20the%20Save%20As%20dialog.%3C%2FP%3E%0A%3CP%3ESelect%20'Excel%20Macro-Enabled%20Workbook%20(*%2Cxlsm)'%20from%20the%20'Save%20as%20type'%20drop-down.%3C%2FP%3E%0A%3CP%3EClick%20Save.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2686043%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2686043%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3Bok%20so%20I%20converted%20the%20file%20and%20put%20in%20the%20code%20you%20shared%20under%20view%20code.%20It%20then%20asks%20me%20to%20create%20a%20macro.%20Once%20I%20create%20the%20new%20macro%20it%20opens%20a%20new%20clear%20window...What%20do%20I%20do%20from%20here%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2686154%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2686154%22%20slang%3D%22en-US%22%3EAlso%20when%20I%20run%20the%20code%20there%20is%20an%20issue%20that%20comes%20up%20which%20says%20object%20required.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2688586%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2688586%22%20slang%3D%22en-US%22%3EHi%20Hans%2C%3CBR%20%2F%3EFirst%20of%20all%20thank%20you%20so%20much%20for%20your%20patience%20in%20helping%20me%20with%20this%20problem%20I%20really%20appreciate%20all%20the%20time%20and%20effort%20you%20have%20put%20in.%20I%20downloaded%20the%20file%20you%20posted%20and%20noticed%20that%20in%20G4%20in%20G4%20all%20I%20see%20is%20Columbus...I%20do%20not%20see%20any%20formula%20or%20macro%20you%20may%20have%20installed.%20I%20have%20never%20used%20VBA%20before%20and%20was%20wondering%20if%20you%20could%20give%20me%20a%20step%20by%20step%20approach%20on%20how%20to%20implement%20the%20code%20in%20my%20existing%20excel.%20Look%20forward%20to%20your%20guidance%20and%20advice.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2688651%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2688651%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1136437%22%20target%3D%22_blank%22%3E%40Wadoodoo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20value%20Columbus%20in%20G4%20was%26nbsp%3B%20just%20a%20dummy%20value%20that%20I%20used%20to%20test%20the%20code.%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20view%20the%20code%2C%20right-click%20the%20sheet%20tab%20and%20select%20'View%20Code'%20from%20the%20context%20menu.%20You%20can%20then%20copy%20the%20code%2C%20switch%20to%20your%20own%20workbook%2C%20select%20'View%20Code'%20from%20the%20context%20menu%20of%20the%20sheet%20tab%20and%20paste.%3C%2FP%3E%0A%3CP%3EDon't%20forget%20to%20save%20your%20workbook%20as%20a%20macro-enabled%20workbook%20(.xlsm).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2688663%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2688663%22%20slang%3D%22en-US%22%3EHi%20Hans%2C%3CBR%20%2F%3EThank%20you%20for%20the%20prompt%20response.%20I%20have%20already%20added%20the%20code%20to%20my%20macro%20enabled%20worksheet%20however%20the%20values%20are%20not%20being%20generated%20in%20excel.%20I%20also%20want%20to%20confirm%20that%20I%20plan%20to%20use%20this%20across%20multiple%20columns%20not%20just%20G4%20is%20the%20code%20scalable%20for%20all%20columns%20in%20the%20workbook%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2688683%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20Index%20Match%20from%20multiple%20closed%20workbooks%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2688683%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1136437%22%20target%3D%22_blank%22%3E%40Wadoodoo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECan%20you%20explain%20in%20more%20detail%20what%20you%20want%20to%20do%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Dear Tech Community,

 

I am trying to reference multiple closed Excel workbooks with different file paths and file names. My initial approach was to define the file path and file name in different cells and concatenate it into the string with the relevant syntax (i.e putting square brackets around the file name, putting an exclamation point after the sheet etc.]

 

A1 - File PathB1 - File NameC1 - Sheet NameD1 - Concatenated String FormulaE1 -Index Match Formula
 C:\Users\wadoodoo\Desktop\Cash Flow Tools\Money\  Sample Excel.xlsx Sample Sheet=CONCATENATE("'" & A1 & "[" & B1 & "]" & C1& "'")=INDEX('D1'!$C:$C,MATCH(G5,'D1'!$B:$B,0))

 

Unfortunately this does not work. Every time I have to manually select the file which is really tedious as I have to do this across 50 different files and each row refers to a different closed workbook.

 

Is there any way I can make this process a bit more dynamic since all I want to do is change the file name and excel should be able to pick up all the relevant data from the new file automatically. Each file will have a new version on a bi-weekly/monthly basis. 

 

Look forward to any guidance and advice. Thank you in advance. 

32 Replies

@Wadoodoo 

You'd need the INDIRECT function for this, but unfortunately this only works with references to other workbooks if they are open, not if they are closed...

@Hans Vogelaar thank you for the prompt response and help. I have used the INDIRECT function already and have a worksheet linked with all the other worksheets using INDIRECT...I dont mind using some VBA code to get this done but I have no idea how to start. If you do know some VBA could you please guide me as to which code could execute this task?

@Wadoodoo 

Try this:

Right-click the sheet tab.

Select View Code from the context menu.

Copy the following code into the worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng As Range
    Dim r As Long
    Dim s As String
    Dim f As String
    On Error GoTo ErrHandler
    If Not Intersect(Range("A1:C50"), Target) Is Nothing Then
        Application.ScreenUpdating = False
        Application.EnableEvents = False
        For Each rng In Intersect(Range("A1:C50"), Target).Rows
            r = rng.Row
            s = "'" & Range("A" & r).Value & "[" & Range("B" & r).Value & "]" & Range("C" & r).Value & "'!"
            f = "=INDEX(" & s & "$C:$C,MATCH(G4," & s & "$B:$B,0))"
            Range("E" & r).Formula = f
        Next rng
    End If
ExitHandler:
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    Exit Sub
ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
End Sub

Switch back to Excel.

Save the workbook as a macro-enabled workbook (.xlsm).

Make sure that you allow macros when you open the workbook.

I don't think this worked....also what do I save the macro as?

@Wadoodoo 

After creating the code as described in my previous reply and switching back to Excel, press F12 to activate the Save As dialog.

Select 'Excel Macro-Enabled Workbook (*,xlsm)' from the 'Save as type' drop-down.

Click Save.

@Hans Vogelaar ok so I converted the file and put in the code you shared under view code. It then asks me to create a macro. Once I create the new macro it opens a new clear window...What do I do from here?

Also when I run the code there is an issue that comes up which says object required.

@Wadoodoo 

I'm not sure what exactly you have done. Here is a sample workbook. Edit G4 to a value you expect to work, then edit A1, B1 or C1, or try entering data in the rows below.

It worked when I tested it with paths/workbooks on my computer.

Hi Hans,
First of all thank you so much for your patience in helping me with this problem I really appreciate all the time and effort you have put in. I downloaded the file you posted and noticed that in G4 in G4 all I see is Columbus...I do not see any formula or macro you may have installed. I have never used VBA before and was wondering if you could give me a step by step approach on how to implement the code in my existing excel. Look forward to your guidance and advice.

@Wadoodoo 

The value Columbus in G4 was  just a dummy value that I used to test the code.

If you want to view the code, right-click the sheet tab and select 'View Code' from the context menu. You can then copy the code, switch to your own workbook, select 'View Code' from the context menu of the sheet tab and paste.

Don't forget to save your workbook as a macro-enabled workbook (.xlsm).

Hi Hans,
Thank you for the prompt response. I have already added the code to my macro enabled worksheet however the values are not being generated in excel. I also want to confirm that I plan to use this across multiple columns not just G4 is the code scalable for all columns in the workbook?
Hi Hans,

Another question I had is did you put any code in the set of cells under column G or was the workbook able to pick out the data automatically? Thank you so much for your guidance and advice.

@Wadoodoo 

 

Can you explain in more detail what you want to do? 

@hans

Absolutely...so I am essentially dealing with a cashflow statement where each line item from the cash flow statement is taken out from a separate workbook. The data I am trying to match it against is the date which is the same across all workbooks. I want excel to be able to do this while the workbooks are closed.

Currently I have hard coded the file path within the index match syntax like so:

=IFERROR(INDEX('C:\Users\harsh\Desktop\Cash Flow Tools\Line Items\[Discounts given.xlsx]Discounts given'!$C:$C,MATCH(G$5,'C:\Users\harsh\Desktop\Cash Flow Tools\Line Items\[Discounts given.xlsx]Discounts given'!$B:$B,0)),0)

Like this there are 50 other line items (i.e workbooks) which I have hardcoded into my excel. This however is not a scalable solution since these sheets are updated on a monthly/bi-weekly basis (depending on the line item).

What I want to do is set up a system where I just need to change the name of the workbook and sheet in two different cells and the workbook will be able to automatically update without having to manually change the code and define the file path across every single row.

I hope this makes sense and please do advise if you need any further clarification.

Thank You.

@Wadoodoo 

Thanks. In which columns do you want such formulas?

From G onwards...However could you explain to me how you call the macro to run across these columns?
I would like it to continue indefinitely. Otherwise till XFD.

@Wadoodoo 

Do you really have thousands and thousands of columns with data? That would be a disaster, performance-wise...