Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is Google Sheets script equivalent of Excel VBA's UsedRange

In Excel VBA I can loop through the cells of a worksheet but I can optimize this loop by only looping through the worksheet’s UsedRange. UsedRange is a rectangle that encompasses all cells that contain something (value, formula, text etc.) or have done previously and are now empty.

Essentially, the UsedRange encompasses every cell that has been touched.

UsedRange does not appear in the list of methods for a Google Sheet

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is UsedRange called something different in the Google Sheets world or is it just missing?

>Solution :

To get the range of cells that encompasses all values in a sheet, use Sheet.getDataRange().

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading