![]() |
| サイトマップ | |
|
関数 block
は、左上のセルと右下のセルの範囲をそれぞれ行と列で指定して、ワークシートのセルのブロックを返します。
block
(column 1 , row 1 , column 2 , row 2)
引数 column 1 , row 1 は領域の左上のセル座標で、引数 column 2 , row 2 は領域の右下のセル座標です。この範囲内にある全ての値を返します。ブロックに対して行われる演算は、常にブロックを返します。
引数 column 2 , row 2 を省略した場合は、ワークシートにある最後の行データと列データが最後の行および/または列となります。ブロックの値を別のブロックに代入する場合、最後の列および/または列は、右辺のブロックと同じ大きさを持つように最後の行と列が決められます。(以下の例をご覧ください。)
列と行の引数は全てスカラーで指定します (範囲は使用できません) 。引数 column に列名を使用する場合は、クォーテーションマークで囲みます。関数 block
は、列名と一致するワークシートの列を使用します。
block(5,1) = -block(1,1,3,24)
は、cell(1,1)
と cell(3,24)
の範囲にある値の符号を反転し、cell(5,1)
で始まるブロックに代入します。
The block function returns a block of cells from the worksheet, using a range specified by the upper left and lower right cell row and column coordinates.
block(column 1,row 1,column 2,row 2)
The column 1 and row 1 arguments are the coordinates for the upper left cell of the block; the column 2 and row 2 arguments are the coordinates for the lower right cell of the block. All values within this range are returned. Operations performed on a block always return a block.
If column 2 and row 2 are omitted, then the last row and/or column is assumed to be the last row and column of the data in the worksheet. If you are equating a block to another block, then the last row and/or column is assumed to be the last row and column of the equated block (see the following example).
All column and row arguments must be scalar (not ranges). To use a column title for the column argument, enclose the column title in quotes; block uses the column in the worksheet whose title matches the string.
The command block(5,1) = -block(1,1,3,24) reverses the sign for the values in the range from cell (1,1) to cell (3,24) and places them in a block beginning in cell (5,1).