I am working on adding functionality to a Google Spreadsheet. The spreadsheet imports data from the web, and I have it all formatted nicely. One of my columns is a series of strings, formatted in one of two ways - String or *String * without the space (basically importing italics from the web).
I am trying to come up with a script that runs when I open my spreadsheet, that will:
- Unhide all rows in my spreadsheet
- Loop through the spreadsheet
- Hide every row where column 2(B) begins with an Asterisk
I have the following:
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("DoDH");
sheet.showRows(1, sheet.getMaxRows());
for(var i=1; i<sheet.getMaxRows()+1; ++i){
if (sheet.getRange(i, 2).getValue().){
sheet.hideRow(i)
}
}
}
I don't know how to access the string inside each cell, and how to access characters within the string. Thank you in advance for any help.