SSpread.SetCellBorderメソッド

 

説明

 

セル周囲の罫線の色および線種を設定します。

 

まず、引数indexに対象とする罫線部分を指定します。

セル範囲の周囲に罫線を設定するには、引数colrowcol2row2でセル範囲を指定し、引数index$CellBorderIndexOutlineを指定します。

1つのセルに罫線を設定するには、引数colcol2に列番号(同じ値)、rowrow2に行番号(同じ値)を設定します。

 

セルの罫線の色、線種を取得したい場合は、GetCellBorderメソッドを使用してください。

 

呼出形式

 

SetCellBorder(col, row, col2, row2, index, color, style)

戻り値

 

なし

引数

 

col

最初のセルの列番号

row

最初のセルの行番号

col2

最後のセルの列番号

row2

最後のセルの行番号

index

設定対象の罫線部分

以下の値の組み合わせを指定します。

定数

説明

$CellBorderIndexLeft

1

セルの左罫線

$CellBorderIndexRight

2

セルの右罫線

$CellBorderIndexTop

4

セルの上罫線

$CellBorderIndexBottom

8

セルの下罫線

$CellBorderIndexOutline

16

セル範囲の外枠

color

罫線の色

色定数または#RRGGBB形式を指定します。

style

線種

以下の値を指定します。

定数

説明

$CellBorderStyleDefault

0

罫線なし(デフォルトのグリッドを表示)

$CellBorderStyleSolid

1

実線

$CellBorderStyleDash

2

破線

$CellBorderStyleDot

3

点線

$CellBorderStyleDashDot

4

一点鎖線

$CellBorderStyleDashDotDot

5

二点鎖線

$CellBorderStyleBlank

6

罫線とグリッド線を消去

$CellBorderStyleFineSolid

11

ドットが1つおきの線

$CellBorderStyleFineDash

12

細かい破線

$CellBorderStyleFineDot

13

細かい点線

$CellBorderStyleFineDashDot

14

細かい一点鎖線

$CellBorderStyleFineDashDotDot

15

細かい二点鎖線

 

例外

 

EXT-28

SetCellBorderメソッドでエラーが発生しました

 

使用例

SetCellBorder(2, 2, 2, 2, $CellBorderIndexOutline, $RED, $CellBorderStyleSolid);
SetCellBorder(2, 4, 3, 6, $CellBorderIndexOutline, $BLUE, $CellBorderStyleDot);
SetCellBorder(4, 2, 4, 6, $CellBorderIndexRight + $CellBorderIndexTop, $GREEN, $CellBorderStyleFineSolid);

 

関連項目

 

GetCellBorderメソッド

 



「オンラインマニュアル」一覧へ戻る
「Bizの宝箱」TOPへ戻る