Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 4 characters in body
Source Link
serenesat
  • 10k
  • 30
  • 33
  • 50

I have a range of data on sheet5 which needs to be copied and inserted 27 columns in from the end of sheet1. I can get it to insert the column in the right place but it doesn't copy the data. I am new to scripting so any advice would be of great help.

Here is code I am using:

function store() {
  var ss = SpreadsheetApp.getActiveSpreadsheet ();

  var source = ss.getRange ("Sheet5!D4:D80");

  var destSheet = ss.getSheetByName("Sheet1");

  var lastCol = destSheet.getLastColumn() -27;

  destSheet.insertColumnAfter(lastCol);

  source.copyTo(destSheet.getRange(lastCol + 1,1), {contentsOnly: true});

  SpreadsheetApp.getUi().alert('Played today Recorded');
}

I have a range of data on sheet5 which needs to be copied and inserted 27 columns in from the end of sheet1. I can get it to insert the column in the right place but it doesn't copy the data. I am new to scripting so any advice would be of great help.

Here is code I am using:

function store() {
  var ss = SpreadsheetApp.getActiveSpreadsheet ();

  var source = ss.getRange ("Sheet5!D4:D80");

  var destSheet = ss.getSheetByName("Sheet1");

  var lastCol = destSheet.getLastColumn() -27;

  destSheet.insertColumnAfter(lastCol);

  source.copyTo(destSheet.getRange(lastCol + 1,1), {contentsOnly: true});

  SpreadsheetApp.getUi().alert('Played today Recorded');
}

I have a range of data on sheet5 which needs to be copied and inserted 27 columns in from the end of sheet1. I can get it to insert the column in the right place but it doesn't copy the data. I am new to scripting so any advice would be of great help.

Here is code I am using:

function store() {
  var ss = SpreadsheetApp.getActiveSpreadsheet ();

  var source = ss.getRange ("Sheet5!D4:D80");

  var destSheet = ss.getSheetByName("Sheet1");

  var lastCol = destSheet.getLastColumn() -27;

  destSheet.insertColumnAfter(lastCol);

  source.copyTo(destSheet.getRange(lastCol + 1,1), {contentsOnly: true});

  SpreadsheetApp.getUi().alert('Played today Recorded');
}
deleted 132 characters in body
Source Link

I have a range of data on sheet5 which needs to be copied and inserted 27 columns in from the end of sheet1. I can get it to insert the column in the right place but it doesn't copy the data. I am new to scripting so any advice would be of great help.

Here is code I am using:

function store() {
  var ss = SpreadsheetApp.getActiveSpreadsheet ();

  var source = ss.getRange ("Sheet5!D4:D80");

  var destSheet = ss.getSheetByName("Sheet1");

  var lastCol = destSheet.getLastColumn() -27;

  destSheet.insertColumnAfter(lastCol);

  source.copyTo(destSheet.getRange(lastCol + 1,1), {contentsOnly: true});

  SpreadsheetApp.getUi().alert('Played today Recorded');
}

Here is a link to the sheet:

https://docs.google.com/spreadsheets/d/1Meb53ouWvl55uccclrI99VLbia_EPxRjStsItswKmmM/edit?usp=sharing

I have a range of data on sheet5 which needs to be copied and inserted 27 columns in from the end of sheet1. I can get it to insert the column in the right place but it doesn't copy the data. I am new to scripting so any advice would be of great help.

Here is code I am using:

function store() {
  var ss = SpreadsheetApp.getActiveSpreadsheet ();

  var source = ss.getRange ("Sheet5!D4:D80");

  var destSheet = ss.getSheetByName("Sheet1");

  var lastCol = destSheet.getLastColumn() -27;

  destSheet.insertColumnAfter(lastCol);

  source.copyTo(destSheet.getRange(lastCol + 1,1), {contentsOnly: true});

  SpreadsheetApp.getUi().alert('Played today Recorded');
}

Here is a link to the sheet:

https://docs.google.com/spreadsheets/d/1Meb53ouWvl55uccclrI99VLbia_EPxRjStsItswKmmM/edit?usp=sharing

I have a range of data on sheet5 which needs to be copied and inserted 27 columns in from the end of sheet1. I can get it to insert the column in the right place but it doesn't copy the data. I am new to scripting so any advice would be of great help.

Here is code I am using:

function store() {
  var ss = SpreadsheetApp.getActiveSpreadsheet ();

  var source = ss.getRange ("Sheet5!D4:D80");

  var destSheet = ss.getSheetByName("Sheet1");

  var lastCol = destSheet.getLastColumn() -27;

  destSheet.insertColumnAfter(lastCol);

  source.copyTo(destSheet.getRange(lastCol + 1,1), {contentsOnly: true});

  SpreadsheetApp.getUi().alert('Played today Recorded');
}
added 62 characters in body
Source Link
Alex
  • 22.8k
  • 12
  • 83
  • 104
Loading
Source Link
Loading