firstly i am a beginner so i apologies in advance if anything is not clear. so basically i have one excel workbook that collects values (basically sum) from tables in 4 other workbooks (all workbooks exist in the same file and identified as 1 to 4 as an example), currently am using a macro to collect and sum the values (sample shown below).
Range("D4").Select
ActiveCell.FormulaR1C1 = "=[1.xlsm]Sheet1!R4C3+RC + [2.xlsm]Sheet1!R4C3+RC + [3.xlsm]Sheet1!R4C3+RC + [4.xlsm]Sheet1!R4C3+RC"
Range("D5").Select
ActiveCell.FormulaR1C1 = "=[1.xlsm]Sheet1!R5C3+RC + [2.xlsm]Sheet1!R5C3+RC + [3.xlsm]Sheet1!R5C3+RC + [4.xlsm]Sheet1!R5C3+RC"
Range("D6").Select
ActiveCell.FormulaR1C1 = "=[1.xlsm]Sheet1!R6C3+RC + [2.xlsm]Sheet1!R6C3+RC + [3.xlsm]Sheet1!R6C3+RC + [4.xlsm]Sheet1!R6C3+RC"
as you can see the current method is a little messy. and i was wondering if there is a simpler way to make it work without having to manually mention the names of all the workbooks (like create an array with all the xlsm files in the same path)
thank you in advance and hope i wasn't confusing :)