NumberOfFilesChosen = tempFileDialog.Showįor i = 1 To 'Allow the user to select multiple workbooks Set tempFileDialog = Application.fileDialog(msoFileDialogFilePicker) Set mainWorkbook = Application.ActiveWorkbook 'Merges all files in a folder to a main file.ĭim mainWorkbook, sourceWorkbook As Workbook Position the cursor within the code and click start (the green triangle) on the top.
The INDIRECT formula has only one argument: The link to another cell which can also be located within another workbook.
Let’s take a closer look at how to build the formula. Only condition: the source file must be open in the background. With the INDIRECT formula you can link to other files.