Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Copy to next free cell in specific Column

$
0
0

I'm trying to copy some specific cell to the next empty cell in an other sheet. I don't get how to achieve this. Is there someone that can help me?

There are three more ranges that have to get into the other sheet. the hole range where to paste P7:x7P10:X10P13:T13 (in this order) should be copied to next free Cell at column C starting @ C3I only need the text inside the cell´s that will be copied

function ex1() { var ss = SpreadsheetApp.getActiveSpreadsheet() var database = ss.getSheetByName("Wochenarchiv"); var source = ss.getSheetByName('K1');   var dataToCopy = source.getRange('P7:X7'); // also need P10:X10 and P13:T13  var copyToSheet = ss.getSheetByName("Wochenarchiv");    var lastRow = copyToSheet.getLastRow();  for (i = 1; i<11 ;i++){    var Paste = copyToSheet.getRange(lastRow + 1,i).setValues(dataToCopy.getCell(1,i).getValues());  }}

Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>