Sheet.getRange(1,1,1,12)
I cannot understand the arguments 1,1,1,12
. What is this - the sheet id or row or what?
method getRange(row, column, optNumRows, optNumColumns)
here what does optNumRows
and optNumColumns
mean???
Found these docu on the google docu pages:
In your example, you would get (if you picked the 3rd row) "C3:O3", cause C --> O is 12 columns
edit
Using the example on the docu:
// The code below will get the number of columns for the range C2:G8
// in the active spreadsheet, which happens to be "4"
var count = SpreadsheetApp.getActiveSheet().getRange(2, 3, 6, 4).getNumColumns(); Browser.msgBox(count);
The values between brackets:
2: the starting row = 2
3: the starting col = C
6: the number of rows = 6 so from 2 to 8
4: the number of cols = 4 so from C to G
So you come to the range: C2:G8
I know this is an older thread but I thought a graphic might help see this visually.
getRange(row, column, optNumRows, optNumColumns)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With