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

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

matlab - error with cyclic autocorrelation function -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -