Denis
Denis

Reputation: 189

Automatic copy table to a new Sheet without formula (Google Sheets script)

There is a Sheet, which consists of a table with formulas. How it possible to get only values (without formulas) to a second Sheet? I need the process to apply automatically (without Copy Paste by hands).

Upvotes: 0

Views: 1643

Answers (2)

Jacque
Jacque

Reputation: 765

You can try using copyTo(). By default both the values and formatting are copied, but this can be overridden using advanced arguments.

// The code below copies only the values of the first 5 columns over to the 6th column.
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange("A:E").copyTo(sheet.getRange("F1"), {contentsOnly:true});

The advanced parameters are the following:

  • formatOnly: designates that only the format should be copied
  • contentsOnly: designates that only the content should be copied

Upvotes: 1

player0
player0

Reputation: 1

  • CTRL + C the table
  • CTRL + SHIFT + V to the second sheet

0

Upvotes: 0

Related Questions