google apps script - How to find if sheet is empty? -


i getting data range of sheet , using range.getnumrows() number of rows in google spreadsheet using google apps script.

but when sheet happens empty, range.getnumrows() still returns 1 instead of 0. guessing because range has have @ least 1 cell.

is there (simple) way number of rows in sheet without having problem?

i know loop through cells in sheet check empty, doesn't seem efficient.

i stumbled across answer on app script documentation.

i using sheet.getlastrow() now


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -