I thought this would be more simple and easy to find online, but I'm having a difficult time so I'll try here first. I'm Looking for a script to search my Google Sheets for a partial text match in a cell and if it contains a partial match then clear or delete entire cell. I've seen this out there that deletes the entire row, but I want to delete just the cell with a partial match.
For example, search through and clear or delete the cell data that contains any partial match to 'Print'
There will be a random image name and number in front of the word Print like "19-Test-IMG_5690 :: Print"
Is it possible to have a script search my sheet or range of cells and clear or delete those cells with the partial match?
This was the closest I could find: That does what I want but only in column B and it doesn't work on partial matches.
function clean0() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getRange('B:B').getDisplayValues();
var range = [];
data.forEach(function(e, i){
if (e[0] == "Print") range.push("B" + (i + 1));
});
sheet.getRangeList(range).clearContent();
}