This code works for me if I am importing two sheets:
={IMPORTRANGE("Sheet1Key","SheetName!A2:A500");IMPORTRANGE("Sheet2Key","SheetName!A2:A500")}
However, I have multiple sheets, all in the same folder, all with the data in the first sheet and all with the data in the same cells.
Is it possible to somehow either import from a folder or somehow add the IDs or names of all files within that folder automatically?
I am not sure what you mean by import all the files within that folder automatically. But what you could do is use the following code that I made a while ago. (You need to make it under scripts.google.com and you need to run the code) The only thing you would need to change is the folder name where I wrote “type name of folder”
function listFolderContents() {
var foldername = 'type name of folder';
var folderlisting = 'URL listing for folder ' + foldername;
var folders = DriveApp.getFoldersByName(foldername)
var folder = folders.next();
var contents = folder.getFiles();
var ss = SpreadsheetApp.create(folderlisting);
var sheet = ss.getActiveSheet();
sheet.appendRow( ['name', 'link'] );
var file;
var name;
var link;
var row;
while(contents.hasNext()) {
file = contents.next();
name = file.getName();
link = file.getUrl();
sheet.appendRow( [name, link] );
}
};
It will create a google spreadsheet called “URL listing for folder (name of folder) located inside the folder you are trying to get the files for. The spreadsheet will contain an array of all the file URL’s. It should be relatively easier to create the import range given the URL’s. You may be able to pick my code apart and use parts that help you with your goal. Hope this helps.