I need to get the file name, not the sheet itself. I used the advice from
Is there a Google Sheets formula to put the name of the sheet into a cell?
but I need something else. please help!
I need to get the file name, not the sheet itself. I used the advice from
Is there a Google Sheets formula to put the name of the sheet into a cell?
but I need something else. please help!
You can use a Script to easily do it. I recommend you to take a look at the SpreadsheetApp documentation, specially at the setValue method from the Range Class and the getName method from DataSourceParameter.
The structure of the script could be:
1. Get the active Spreadsheet
2. Get the name
3. Set the value in an specified Range.
Here is the code to input title of workbook to a particular cell.
function test(){
var title=SpreadsheetApp.getActive().getName();//title of workbook
var currentSheet=SpreadsheetApp.getActive().getSheetByName('Sheet2'); //sheet that you want to input the title
currentSheet.getRange('A18:A18').setValue(title); //put title in cell A18 (You can change to other cells like B2 etc)
}