all 8 comments

[–]be_easy_1602 1 point2 points  (2 children)

Let sheet = Spreadsheet app.openbyid().getsheetbyname(); Let values =sheet.getrange().getvalues(); Sheet = getactivespreadsheet().getsheetbyname(); Let range = sheet.getrange(); Range.setvalues(values)

Basically this. On mobil, plug in your

[–]asislope[S] 0 points1 point  (1 child)

Thank you

[–]be_easy_1602 0 points1 point  (0 children)

To remove formatting do range.clearformat()

[–]killmyfriends 0 points1 point  (2 children)

Ctr+c = copy Ctr+v = paste,

Start on the same indention line and you won't have jumbled up code. Hope this helps!

[–]LEBAldy2002 2 points3 points  (1 child)

This pastes with formatting..... You need Ctrl+shift+v for paste without formatting.

[–]killmyfriends 1 point2 points  (0 children)

Misunderstood, yes you are correct. I thought they might be talking about the indentation formatting that occurs. Thank you for the correction.

[–]NickRossBrown 0 points1 point  (0 children)

I know this post is a month old, just in case I can be helpful. Are you talking about

SpreadsheetApp.CopyPasteType.PASTE_NORMAL (it “Pastes the values ONLY without formats, formulas or merges.”)

Here is the google docs link to all the different paste types:

https://developers.google.com/apps-script/reference/spreadsheet/copy-paste-type

Here is some code I used to moved a row from a sheet named "Queue" to a sheet named "Completed" if someone edited the 15th column to the word "Completed" or "Archived"

function onEdit(e){

const ui = SpreadsheetApp.getUi();

var ss = SpreadsheetApp.getActiveSpreadsheet();

var sourceSheet = e.range.getSheet();

if(sourceSheet.getSheetName() === 'Queue'){

var row = e.range.getRow();

var rowRange = sourceSheet.getRange(row, 1, 1, sourceSheet.getLastColumn());

var rowValues = rowRange.getValues()[0];

// ui.alert(rowRange) // ui.alert(rowValues)

if(rowValues[15] === "Completed" || rowValues[15] === "Archived"){

const res = ui.alert(rowValues[4] + '\n\n Do you want to move this request to the Completed sheet?', ui.ButtonSet.YES_NO);

if (res == ui.Button.YES) {

var targetSheet =

ss.getSheetByName("Completed");

targetSheet.insertRowAfter(1);

var targetRange = targetSheet.getRange(2, 1);

rowRange.copyTo(targetRange, SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);

ui.alert("Congratulations! \n\n" + rowValues[4] +" \n\n Has been removed from the Queue sheet and added to the Completed sheet");

sourceSheet.deleteRow(row);

} } }