0

What is the syntax for selecting the full range of rows which contain data?

Say for instance I have 200 rows of data. Im running some functions which loop through rows. If I wanted to select the range of these rows manually from column A, I would write is as A1:A200.
But is there a way to write it from "A1" : "last row in the column A that contains an entry"

Alternatively is there a way to write A1:"end of column A, regardless of entries"?

thanks

2 Answers 2

1

You can write A1:A to get the entire column, or A1:Z to get a range of columns. In Apps Script, you can call sheet.getLastRow() (or sheet.getLastColumn()) to get the last row containing data and use that to write your loops.

References

Sign up to request clarification or add additional context in comments.

Comments

0

You can also consider the use of getDataRange().This method returns a Range corresponding to the dimensions in which data is present.

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.