I am new to Google Sheets Apps Script, and I've tried dozens of scripts to make this work but haven't been successful. I'm trying to write a script that copies Topic Data from Column 'C' if a neighboring checkbox in Column 'B' is checked, and pastes that Topic Data into the next empty cell starting from the 5th row in Column 'A'. Any help will be greatly be appreciated! Thank you.
Sample Sheet: https://docs.google.com/spreadsheets/d/1g9tn907Ve4rGFo7UI1NwYDBQqK5Y26TOSD_KnEfSWKw/edit?usp=sharing
This is my latest attempt:
function onEdit(){
var ss = SpreadsheetApp.getActive().getActiveSheet();
var selection = ss.getActiveCell().getA1Notation().split("");
var row = ss.getActiveCell().getRow();
//Gets the checkbox value
var checkBoxValue = ss.getActiveCell().getValue().toString();
if(selection[0] != "B") return;
switch(checkBoxValue){
case checkBoxValue = "true":
ss.getRange("C"+row).copyTo(ss.getRange('A5:A').getValues().filter(String).length + 5);
break;
}
}
I've been able to retrieve Data when a checkbox is checked but I can't figure out how to paste the Data into the next empty cell in Column 'A'. The script above was the latest iteration but this one in particular was one that I borrowed from other boards to see if I could adapt it...No Luck.