I have two lists. List one has all current employee names and list two has all current and past employee names.
I need to develop a script that returns all the past names with the info connected to them on list two. I wrote this code which matches all current names to their current info but cannot figure out how to do the reverse.
function current(){
var app = SpreadsheetApp;
var activeSheet = app.getActiveSpreadsheet();
var issued = app.getActiveSpreadsheet().getSheetByName("Issued");
var waiting = app.getActiveSpreadsheet().getSheetByName("Waiting for Inventory");
var active = app.getActiveSpreadsheet().getSheetByName("Active Officers");
for (var j = 2; j<100; j++){
var officer = issued.getRange(j,11).getValue();
for(var i = 2; i<70; i++){
var officerList = active.getRange(i, 2).getValue();
if (officer === ""){
continue;
}
if (officer === officerList){
var rowInfo = issued.getRange(j,1,1,12).getValues();
var lastrow = waiting.getLastRow();
waiting.getRange(lastrow+1,1,1,12).setValues(rowInfo);
}
}
}
}