Sheet.getRange(1,1,1,12) 括号中的数字表示什么? [英] Sheet.getRange(1,1,1,12) what does the numbers in bracket specify?

查看:16
本文介绍了Sheet.getRange(1,1,1,12) 括号中的数字表示什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sheet.getRange(1,1,1,12)

我无法理解参数 1,1,1,12 .这是什么 - 工作表 ID 或行或什么?

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)

这里optNumRowsoptNumColumns 是什么意思???

here what does optNumRows and optNumColumns mean???

推荐答案

谷歌文档页面:

  • row --- int --- 范围的顶行
  • column --- int --- 范围最左边的列
  • optNumRows --- int --- 范围内的行数.
  • optNumColumns --- int --- 范围内的列数

在您的示例中,您会得到(如果您选择第三行)C3:O3",导致 C -->O 是 12 列

In your example, you would get (if you picked the 3rd row) "C3:O3", cause C --> O is 12 columns

编辑

使用文档上的示例:

//下面的代码将获取范围 C2:G8 的列数
//在活动电子表格中,恰好是4"
var count = SpreadsheetApp.getActiveSheet().getRange(2, 3, 6, 4).getNumColumns();Browser.msgBox(count);

// 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);

括号之间的值:
2:起始行 = 2
3:起始col = C
6:行数 = 6 所以从 2 到 8
4:cols 的数量 = 4 所以从 C 到 G

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

所以你来到了范围:C2:G8

So you come to the range: C2:G8

这篇关于Sheet.getRange(1,1,1,12) 括号中的数字表示什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆