0

script (attempt):

function moveValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange('P1!B10');
                            source.copyTo(ss.getRange('P1!B11'), {contentsOnly: true}); }

function moveValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange('P2!B10');
                            source.copyTo(ss.getRange('P2!B11'), {contentsOnly: true}); }

function moveValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange('P3!B10');
                            source.copyTo(ss.getRange('P3!B11'), {contentsOnly: true}); }

function moveValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange('D1!B10');
                            source.copyTo(ss.getRange('D1!B11'), {contentsOnly: true}); }

function moveValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange('D2!B10');
                            source.copyTo(ss.getRange('D2!B11'), {contentsOnly: true}); }

function moveValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange('D3!B10');
                            source.copyTo(ss.getRange('D3!B11'), {contentsOnly: true}); }

function moveValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange('P!B10');
                            source.copyTo(ss.getRange('P!B11'), {contentsOnly: true}); }

in one spreadsheet I have these sheets "P1, P2, P3, ..., P" and in every sheet I have a button. next, I need to achieve that if I am in let's say sheet D1 and press button in that sheet a script will execute.

0

got it...

function moveValuesOnly1() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange("P1!B10");
                            source.copyTo(ss.getRange("P1!B11"), {contentsOnly: true}); }

function moveValuesOnly2() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange("P2!B10");
                            source.copyTo(ss.getRange("P2!B11"), {contentsOnly: true}); }

function moveValuesOnly3() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange("P3!B10");
                            source.copyTo(ss.getRange("P3!B11"), {contentsOnly: true}); }

function moveValuesOnly4() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange("D1!B10");
                            source.copyTo(ss.getRange("D1!B11"), {contentsOnly: true}); }

function moveValuesOnly5() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange("D2!B10");
                            source.copyTo(ss.getRange("D2!B11"), {contentsOnly: true}); }

function moveValuesOnly6() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange("D3!B10");
                            source.copyTo(ss.getRange("D3!B11"), {contentsOnly: true}); }

function moveValuesOnly7() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange('P!B10');
                            source.copyTo(ss.getRange('P!B11'), {contentsOnly: true}); }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.