I am converting VBA script to google script. I am 99% completed. This is problem one of two. I am embarrassed it's so simple yet my VBA head cannot seem to get it right in google script.
My VBA is this this
If Range("A3") <> "BOOKED" Then
xxxxxx(lots of code)
End If
I want the code to not run if cell "A3" = "BOOKED"
.
function ClearDataMacro() {
var spreadsheet = SpreadsheetApp.getActive();
/// end if range (A3:E5)= "BOOKED"
var READY = ""
var READY = spreadsheet.getRange('A3:E5').getValues();
if (READY = "BOOKED") {
spreadsheet.getRange('Y1:Z1').activate();
spreadsheet.getCurrentCell().setValue("OPTION ONE");
}
spreadsheet.getRange('Y2:Z2').activate();
spreadsheet.getCurrentCell().setValue("OPTION TWO") {
spreadsheet.getRange('Y3:Z3').activate();
spreadsheet.getCurrentCell().setValue("OPTION THREE");
}
spreadsheet.getRange('Y4:Z4').activate();
spreadsheet.getCurrentCell().setValue("OPTION FOUR");
}
No matter what boolenan expression I use (<>,=,!=,>,<), the script completely ignores my if
statement and runs the script for all the OPTIONS. I get four answers.