Is it possible to write a google apps script that "binds" two cells together? For example, if a a cell in one sheet is edited, it will automatically update a matching cell in another sheet.
So if sheet1 had a value representing "money spent" in cell A1, and sheet2 had a value representing the same "money spent" in cell B4, I'd want to be able to change the value in sheet2.B4 or sheet1.A1, and both of the cells will always be up to date.
I'm having trouble determining how to create a trigger that could perform this.
To create a bound script in Google Docs, Sheets, or Slides, open a document in Docs, a spreadsheet in Sheets, or a presentation in Slides and click Extensions > Apps Script. To reopen the script in the future, do the same thing or open the script from the Apps Script dashboard.
Creating a Data Model This is the step where you add in your Google spreadsheet database. To do this, click on “Data Modelling” in the header and then click on “+Create Data Model” on top right and select “Data Import”.
Click on a formula within your spreadsheet, click the Find Precedents or Find Dependents button, and immediately see every formula, cell, named range, and element that goes into making up the number you see on your screen.
You can create a trigger that runs a function when a cell in the Sheet is edited:
SpreadsheetTriggerBuilder onEdit()
Then the script would need to find the cell that was edited, get the value, and put the value into the new cell.
You could use getRange()
:
getRange(row, column) of the Sheet Class
See this question also:
StackOverflow get and set
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