Hey there stranger!

Sign up to get access.

Sync Many Tabs without ImportRange()

About this Tutorial

Sync more than two tabs with Apps Script

Video Transcript

0:00 So in a previous video I created this app script that syncs two tabs that we have a sheet one and a sheet two here.
0:07 And this could be that two workers, two separate different people working at the same company on the same sheet want similar information.
0:16 They want also different information at the same exact time. So instead of sharing a sheet and saying here some statuses some names sort of some data and then my notes your notes each like individual person what you can do is create two separate tabs that have exact clearly the same data in A, B, and
0:35 C but then we'll have some differentiating data other in the other columns. And so what we need to do is make sure that she won and she too if this changes to Andy.
0:48 Uh it is going to update over here as well. And it's updated automatically so again if we say oh well actually that was a mistake it was should be Andy K.
0:57 Uh over here it will update automatically. Uh what we're using for this just to refresh is we're using. And then we have this e or event that's happening and based on that event we're going to grab whatever that edit value is.
1:18 If it is just an edit value we're getting the row the cup. We're making sure that if it's on sheet one and the row is beyond one meaning not the header and we're giving it a limit column of five.
1:31 So saying if it's under five so it's the first four columns. Um. We are going to make that edit on the other page.
1:40 We do that here. So how do we set this up for many? So there's two questions here. One question is how do we set this up for many?
1:48 Like if we add a third sheet or fourth sheet. Um. But the second question is. How do we change this?
1:53 Um. Apps Script so that maybe it is not exactly the same section we're editing. And I'm going to actually answer that in a separate video after this.
2:03 And this one we're going to talk about how to sync many tabs. And I think if I just do two.
2:08 Umm. More we're going to you're going to see how this works and you can do any any number more. So what we're going to do is duplicate this.
2:16 We'll call it sheet three. And we'll change the color just so that we visually know we are on a separate sheet.
2:23 Umm. We are getting one through four. We want that edited on each and every one of them. Okay. So how do we do that?
2:33 Already we have if sheet equals sheet one do these things. So we need to add one. Element to this which is edit on umm.
2:44 Do those edits on the third column. So we'll do that. We will get the active sheet two sheet. We will say variable.
2:54 All right, so, third sheet equals sheet three. We will add this variable up here sheet three. So we have it accessible everywhere.
3:08 And that is really all we need to do. We're taking the exact same thing that we did here. Um oh and we need to set that value one here third sheet.
3:18 Uh sorry the name. We just need to change the name. Okay now if we do an edit on the second sheet let's make sure that we are getting.
3:27 We'll see the third sheet as well. Okay so third sheet again edit that and now anytime let's uh save this and double check and just check this should edit any edits on the first and second sheet.
3:44 We'll be on the third sheet. Let's say this should be Frankie. This should be Komodo something similar there is Frankie Komodo Frankie Komodo it's edited on each and every sheet.
3:58 Okay now we need to add the third sheet. Okay so what we can do if we can actually copy this whole thing and let's just edit this.
4:11 So if sheet equals sheet 3 so if sheet 3, edit on sheet 1 plus 2. This will be 1 plus 3 and this will be 2 plus 3.
4:28 So we're now saying okay if it's on sheet 3 again same r- both same limit columns. The 2 sheet should actually be 1.
4:37 That's actually correct and this should be second sheet. We can name this anything we want. Just need the variable to be to add it in there.
4:49 Second sheet. And we already have the first sheet here and instead of editing it on the second sheet until again.
4:57 If sheet 3 is edited now sheet 1 and 2 should be edited as well. Save this, command S, and let's double check again.
5:04 Frankie, oh this should be actually Francis, Francie, or Francie. And let's make sure Komodo is there. That is updating. Is it updating?
5:25 Let's delete it. Might have done it a little too. Komodo. There it is now. It's updating on all three. Now let's say, and e should be, indication be Andy.
5:39 And is it going to edit on second? Yes. Is it edit on first? Yes. Perfect. So now we've added a third sheet.
5:46 Let's add one more just so you see that process one more time. If we add a fourth sheet we need one, more thing but we need, it's sort of adding more to each and every once.
5:56 So we're adding a sheet for whatever name this is. We're to call it, we're going to give it another color as well.
6:05 It's called Deep Blue with a white text. Now, again we need to add the variable up here. Just so we have it sheet for cools sheet for.
6:18 And we need to rename these anything we want but we just make sure they're renamed here in 11, 12, 13, 14.
6:24 And to take to do. This needs to edit in 1, 2, plus 4. So we say variable. 4th sheet equals sheet for.
6:41 Copy the exact same thing we did before. Copy this. Change 3rd sheet for 4th this needs to be plus 4 as well.
6:52 We can copy paste this here. Copy paste this. We're just adding that 4th sheet to each of these that exist.
7:05 One more time and now let's create for the 4th sheet if we're, we're editing if sheet 4, edit on 1, 2 and 3.
7:19 So instead of 1, 2, 4 we're going to take where it's third sheet, third sheet, replace that there. And. And now we are uhh editing.
7:32 Any of the edits we do on 1, 2, 3 or 4 will be replicated on the They're three and so well you can see that it is pretty simple to add more pages We just have to make sure that it's included in each and every one of these and let's see let's double check that it's actually working.
7:51 Let's say air. Yahoo.com. Google.com. Let's see them updated here. It's gonna take up. A moment or two before they does it.
8:03 Make sure we're saved. Oh, we didn't. Ah, I see what we did. If sheet four. There we go. We have to do that.
8:13 One more step. If sheet four. Now it's going to update. So let's delete these and add them again. We will.com.
8:23 I will.com. Boom. Boom. Boom. Done. And done. We've now synced many tabs without the import. And it really is syncing the exact data on each of these.
8:37 In another video I will be sharing with you how to change where the sections are being edited. So just in case maybe you want the edit.
8:48 It's to be on the same page or in different sections instead of right now each of these are exactly the same first four columns.
8:56 Uh maybe you want some other columns updated if something edits on another sheet. So you'll see that in another video.