When you define a range in google spreadsheets, you provide any of the following options:
Returns the range with the top left cell at the given coordinates. | ||
Returns the range with the top left cell at the given coordinates, and with the given number of rows. | ||
Returns the range with the top left cell at the given coordinates with the given number of rows and columns. | ||
Returns the range as specified in A1 notation or R1C1 notation. |
In your case since you only care about one cell, You should use the top option which if to only specify 2 parameters to specify that one cell.
If you want the last row, last column cell, use this:
const clientData = clientSheet.getRange(currentSheet.getLastRow(),currentSheet.getLastRow(),).getDisplayValue();
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/904f4052-5746-4cd2-8163-2f58c58c4c48n%40googlegroups.com.
Ok. I understand what you are trying to do but this can not be done simply by specifying the range.
Only thing that google spreadsheets provides is getLastColumn() method which gives you the last column of the sheet. If some rows do not fill that far, it is up to you to figure out how to find that.
What you may need is a simple loop to go through the data and determine where the end of data is (first blank cell perhaps), then use that info to determine what is the more right side cell is.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/c74cdbdd-35b2-4fe8-96f1-6e824c8a1e7fn%40googlegroups.com.