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

Time:11-30

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

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

CodePudding user response:

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

  • Related