Update Child Sheet Formulas When Parent Updated

  Рет қаралды 841

Spencer Farris

Spencer Farris

Күн бұрын

How to update the formulas on Child sheets when the Parent or Template sheet is updated.
Important Notes:
* No script in this video should be ran manually
* The script updating other Sheets files must be set on a trigger
Sheets (Make a copy from the File menu)
Main sheet: docs.google.co...
Secondary sheet: docs.google.co...
Scripts:
function updateExternalChildSheets(e){
const src = e.source.getActiveSheet();
const r = e.range;
if (src.getName() != "Template" || r.getFormula() == "") return;
const sheets = ["1qr2N3dsic67U7KXP3w61vSAV4Hth0MgIa01_dZtEiYE"];
let ss;
for (let i in sheets){
ss = SpreadsheetApp.openById(sheets[i]).getSheets()[0];
ss.getRange(r.getA1Notation()).setFormula(e.value);
}
}
function onEdit(e) {
if (!e) throw "Do not run from Editor";
updateChildSheets(e);
}
function updateChildSheets(e){
const src = e.source.getActiveSheet();
const r = e.range;
if (src.getName() != "Template" || r.getFormula() == "") return;
const sheets = SpreadsheetApp.getActive().getSheets();
let ss;
for (let i in sheets){
ss = sheets[i];
if (ss.getName() == "Template") continue;
ss.getRange(r.getA1Notation()).setFormula(e.value);
}
}
Connect with me:
• spencer.farris@gmail.com
• spencerfarris.me
• www.linkedin.com/in/spencer-farris/
• Twitter @FarrisSpencer
• Google Product Expert support.google.com/docs/profile/12305
Donate on Paypal: spencer.farris@gmail.com

Пікірлер: 13
@TrenerZvezdnaia
@TrenerZvezdnaia Жыл бұрын
Best!!!
@kentli8812
@kentli8812 Жыл бұрын
so happy to see you back. Very useful tutorial. Thanks
@spauldinggg
@spauldinggg Жыл бұрын
Hurray! You’re back!
@SpencerFarris
@SpencerFarris Жыл бұрын
I'm trying to be!
@sktraders6451
@sktraders6451 Жыл бұрын
Glad to see u back. And i appreciate ur spirit to not to sit back. God bless u. 🙏🚩✌
@SpencerFarris
@SpencerFarris Жыл бұрын
Oh He does. Thank you
@chaos5000
@chaos5000 Жыл бұрын
Welcome back!
@SpencerFarris
@SpencerFarris Жыл бұрын
Thank you! I hope I can be consistent again!
@jamesgrew9659
@jamesgrew9659 Жыл бұрын
It's great to see you back. Could you also do this with regards to a parent spreadsheet child spreadsheet?
@SpencerFarris
@SpencerFarris Жыл бұрын
The last part of the video shows that, yes!
@user-mc2el1fi8w
@user-mc2el1fi8w Жыл бұрын
Great Video! (You typed 0,02 instead of 0,2 for 20%. xD )
@minimaggot269
@minimaggot269 Жыл бұрын
surely you would put the commission rate in a named variable, and link that to the cells.
@SpencerFarris
@SpencerFarris Жыл бұрын
This is dummy data used to illustrate the script. Feel free to use it however you want.
Automatically Replace Value When Entered
8:51
Spencer Farris
Рет қаралды 1,7 М.
AppSheet Update All Child Records When Parent Record is Updated
27:57
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 32 МЛН
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 35 МЛН
Dad Makes Daughter Clean Up Spilled Chips #shorts
00:16
Fabiosa Stories
Рет қаралды 8 МЛН
Секрет фокусника! #shorts
00:15
Роман Magic
Рет қаралды 77 МЛН
How to create a data entry form in Google Sheets [with multiple databases]
14:52
Try This Instead of the XLOOKUP
10:06
Kenji Explains
Рет қаралды 59 М.
Infinite Multiple Dependent Dropdown Lists In Google Sheets
11:36
This ONE VBA Hack Will Save You Hours on Excel
29:09
Victor Chan
Рет қаралды 10 М.
Create a HABIT TRACKER with Google Sheets! *5 MIN TUTORIAL*
6:37
Jeremy's Tutorials
Рет қаралды 29 М.
FASTEST Way To Become a Data Analyst and ACTUALLY Get a Job
14:03
Unorthodox Change
Рет қаралды 236 М.
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 32 МЛН