Generation

generate functionThu, 15 Jun 2023

VBA Script that ignores lines with the word 'obsolete' in an excel txt export

function removeObsolete() { var ss = SpreadsheetApp.getActiveSheet(); var range = ss.getRange("A1:A"); var values = range.getValues(); var count = 0; for (var row in values) { var cell = values[row][0]; if (cell.indexOf('obsolete')==-1) { ss.getRange(parseInt(row)+1, 2).setValue(cell); count++; } } ss.deleteRows(1, values.length - count); }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant