0

Complete newbie, done a record Macro, however need to change the 'F2' cell to next available blank cell in column F, tried multiple things but completely stuck after checking out other forums/videos etc.

`/** @OnlyCurrentDoc */ 


function TransferSODV1() { 
  var spreadsheet = SpreadsheetApp.getActive(); 
  spreadsheet.getRange('S6:AE6').activate();
  var currentCell = spreadsheet.getCurrentCell();
  spreadsheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.DOWN).activate();
  currentCell.activateAsCurrentCell();
  spreadsheet.setActiveSheet(spreadsheet.getSheetByName('SOD Raw Data'), true);
  spreadsheet.getRange('F2');
  spreadsheet.getRange('\'Pull SOD/EOD Figures\'!S6:AE50').copyTo(spreadsheet.getActiveRange(),            SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);`

Tried getNextRow but getting error getNextRow not defined.

Expecting to paste data into next blank cell in column F of sheet SOD Raw Data

  • I thought that this thread might be an answer to your question. https://stackoverflow.com/q/17632165 – Tanaike Apr 06 '23 at 11:22
  • I'm not sure I fully understand what that thread is discussing? complete newbie so sorry! – CraigHelpMe Apr 06 '23 at 11:41
  • Thank you for replying. First, I have to apologize for my poor English skill. And, I apologize that my comment was not useful in your situation. From your reply, I understood that the thread was not useful for your situation. In this case, I think that my understanding of your question was not correct. I apologize for this. So, can I ask you about the detail of your question? I would like to correctly understand your question. – Tanaike Apr 06 '23 at 11:46
  • @Tanaike I think your answer (or a variation) in [Google Appscript: Place text in the first empty row of a specific column](https://stackoverflow.com/a/62368422/1330560) might apply here. – Tedinoz Apr 07 '23 at 01:37
  • Macros can be useful but sometimes they can also be a little confusing. May I try to clarify... You have one spreadsheet. On sheet "Pull SOD/EOD Figures", you have a range "S6:AE50" ("the source"). You want to copy the source to sheet: "SOD Raw Data". The destination range is defined by the first empty cell below Cell F2. Is that correct? – Tedinoz Apr 07 '23 at 01:51
  • @Tedinoz Thank you for your support. I'm worried that from OP's reply, the current question might be different from OP's actual question. If my understanding is correct and that will be useful, I'm glad. – Tanaike Apr 07 '23 at 02:49

0 Answers0