Skip to content
Advertisement

Copy/paste a range from one sheet to several others depending on the value of a cell in a column

In a spreadsheet, I have a tab “CUSTOMERS” with values in the range B4:Q,. These values are imported from another spreadsheet with importrange.

In C4:C of “CLIENTS”, there are the names of 3 products which correspond to the names of 3 other tabs (“DATA”, “EPHAD”, “LIVRET”) which have the same column format as the tab “CLIENTS”.

What I would like to do is to copy all the values from the range B4:Q of “CLIENTS” and paste them into the tabs that correspond to the product (DATA rows in the DATA tab, EPHAD in the EPHAD tab and LIVRET tab in LIVRET).

I don’t just import via FILTER, QUERY or another function because I need the imported content to be editable.

Here is my sheet (the tab “SOURCE IMPORTRANGE” is not there on the original table. I simply inserted the values from the source file into it).

I tried to write a script but I can’t get it to work properly. Here is the script:

JavaScript

Advertisement

Answer

Distributing Rows to sheets named in Column C

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement