Last active
July 3, 2018 06:11
-
-
Save dangtrinhnt/f4cee09c4621512303e3 to your computer and use it in GitHub Desktop.
Find row number by value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function findRowByValue(sheet, value) { | |
| var dataRange = sheet.getDataRange(); | |
| var values = dataRange.getValues(); | |
| for (var i = 0; i < values.length; i++) { | |
| for (var j = 0; j < values[i].length; j++) { | |
| if (values[i][j] == value) { | |
| //Logger.log(i); | |
| return i+1; | |
| } | |
| } | |
| } | |
| return -1; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment