0

First off, I wasn't sure if this question should be in the webapps site or the programming one, but since this is primarily a google sheets question, I put it here.

Basically, in one sheet I have data in cells C14 through F15, so it's 4 columns and 2 rows of data, 8 cells in total. With a script, I'd like to be able to "copy and paste" the values from these cells into B13:E14 on a different sheet.

I understand how to move values from one cell to another with a script, but I'm having trouble doing it with ranges of values.

Does anyone have any ideas?

1 Answer 1

1

You should be able to research this, though I do understand that sometimes it is hard to know exactly what you are looking for. So please regard this answer as some quick-and-dirty assistance to help you come up to speed.

You can use the moveTo() method. Using this method, the amount of code to move data is much shorter than the code required to copy data.

Of course, there are several options for getRange:

Something like this function is all that you need.

function moverange(){
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange("C14:F15").moveTo(sheet.getRange("B13"));
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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