I have been playing around with Google Apps Script today and I am trying to code some custom spreadsheet functions. I have done some searching but cannot find an answer to my query.
I know that on a Google Spreadsheet you can use ImportRange in a cell on a spreadsheet like this:
=ImportRange(spreadsheet_key;sheet!range_of_cells)
My questions are is it possible to do something similar in a Google Apps Script and if so, how?
I want to import a range of cells from a sheet on another spreadsheet (not a sheet on the spreadsheet where the script will reside).
Get data from other sheets in your spreadsheet Open or create a sheet. Select a cell. Type = followed by the sheet name, an exclamation point, and the cell being copied. For example, =Sheet1!
What Is the Difference Between IMPORTRANGE and IMPORTDATA? IMPORTRANGE takes a specific range of data from a spreadsheet. IMPORTDATA scrapes data from a URL and imports it as a . CSV or .
Yes, this is perfectly possible. You just need to call SpreadsheetApp.openById
and then get the desired sheet and ranges normally.
Please take a look at the documentation : range.getValues()
and range.setValues()
are very basic GAS methods and are pretty well described.
Read the tutorial as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With