Following this guide, I am able to link data from my Google Sheet into my Google Doc.
https://support.google.com/a/users/answer/9308662?hl=en
Is there a way to have range size update automatically when the table shrinks and grows?
Following this guide, I am able to link data from my Google Sheet into my Google Doc.
https://support.google.com/a/users/answer/9308662?hl=en
Is there a way to have range size update automatically when the table shrinks and grows?
You can do the following:
Tools > Script editor to open a bound script, and copy the following code. This function retrieves your desired named range and updates it with the current dimensions of your table:const SHEET_NAME = "Sheet1"; // Change according to your preferences
const NAMED_RANGE_NAME = "MY_RANGE"; // Change according to your preferences
function updateNamedRange() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(SHEET_NAME);
const namedRanges = ss.getNamedRanges();
const namedRange = namedRanges.find(namedRange => namedRange.getName() === NAMED_RANGE_NAME);
const range = sheet.getRange("A1").getDataRegion();
namedRange.setRange(range);
}
updateNamedRange with the specified periodicity. You can do that manually (following these steps), or programatically. In order to install this programmatically, copy and run a function like this once:function installTimeTrigger() {
ScriptApp.newTrigger("updateNamedRange")
.timeBased()
.everyMinutes(1)
.create();
}
Sheet1, with a named range title MY_RANGE, and it starts at cell A1. Change all those in your spreadsheet if that's not your case.