Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

New answers tagged

1 vote
Accepted

Replace text in document using A1 notation as variable names in order to retrieve values stored in those cell references

const docId = "xyz"; const sheetId = "abc"; function replaceRefByString() { const doc = DocumentApp.openById(docId) const body = doc.getBody(); const ss = SpreadsheetApp....
Blindspots's user avatar
  • 5,521
1 vote

Macro to return 1 + the value of the cell above

Macro /** @OnlyCurrentDoc */ function myFunction() { const cell = SpreadsheetApp.getActive().getCurrentCell(); cell.setValue(cell.offset(-1, 0).getValue()+1); cell.offset(0, 1).activate(); } ...
Blindspots's user avatar
  • 5,521
0 votes

Replace text in document using A1 notation as variable names in order to retrieve values stored in those cell references

To use Google Apps Scripts effectively you should learn Javascript and about arrays. Google Sheets: A1:A1 and C3:C3 are not proper ways to refer to single cells. Just use A1 and C3, respectively. Also,...
Rubén - Volunteer Moderator -'s user avatar
0 votes

Get list of files from Google drive into google sheets based on date range using app scripts

The JavaScript statement in the question, var folders next = folders.next();, is intended to assign a JavaScript Object to a variable. It uses the DriveApp.FileInterator.next() method. The error ...
Rubén - Volunteer Moderator -'s user avatar
0 votes

How can I view the number of files in a folder from Google Drive?

This is a slightly more thorough version of @penduDev's answer (so credit goes to them). I much prefer this version because it doesn't involve copying someone else's notebook (it shows you from ...
stevec's user avatar
  • 109
2 votes

Printing the date of a cell in the Google Apps Script console

To get the date in cell date!D1 as a text string in the format it shows in the spreadsheet, use Range.getDisplayValue(), like this: function getDateAsShown() { const ss = SpreadsheetApp.getActive(); ...
doubleunary's user avatar
  • 14.7k
-1 votes

Printing the date of a cell in the Google Apps Script console

I get the desired result with this: function myFunction() { const ss = SpreadsheetApp.getActive(); const ws = ss.getSheetByName("date"); const valoreCella = ws.getRange("D1")....
Federica Guidotti's user avatar

Top 50 recent answers are included