1

I am trying to find a script that will search a range ("B29:B28") for a string. The string will come from a variable, lets call it value. I will also be copying this, but for now lets just select it.

So:

function findText() {
  find(value in range("B29:B28")
  make cell containing text active
}

Obviously this code is just what I want, not any type of code.

Thanks for any help!

1 Answer 1

1

Best practice or not, this works:

  var rng = sheet.getRange(28, 2, 11, 1);
  var data = rng.getValues();
  var search = "What to search for"

  for (var i=0; i < data.length; i++) {
    if (data[i][0] == activeBill) {
      data[i][0] = "Sets found cell to this";
      rng.setValues(data);
    } 
  }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.