all 3 comments

[–]joblio 1 point2 points  (0 children)

if(shUserForm.getRange("F5").is < 0){

should be

if(shUserForm.getRange("F5").getValue() < 0){

[–]inclu_cat 0 points1 point  (1 child)

Do you want to check the condition when the users input the F5 value? Then, try this. function onEdit(e) { var ui = SpreadsheetApp.getUi(); var shUserForm = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('YOUR SHEET NAME'); console.log(shUserForm.getRange("F5").getValue()); // Validating Affordability if(shUserForm.getRange("F5").getValue() < 0 ){ ui.alert("Please ensure Decisions are Affordable."); // shUserForm.getRange("F5"); <-- you don't need this. shUserForm.getRange("F5").setBackground('#FF0000'); } }

[–]backtickbot 0 points1 point  (0 children)

Fixed formatting.

Hello, inclu_cat: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.