I know the formula to link data from another worksheet is:
='WorksheetName'!A1
or
=[Filename]WorksheetName!$A$1
depending on whether that worksheet is in another file or not. I want the formula to obtain the file name/worksheet name from an adjacent cell, is that possible?