文字列の縦位置を取得・設定する(VerticalAlignment プロパティ)
2015/08/26
VerticalAlignment プロパティ
VerticalAlignment プロパティで、指定したセル範囲内における、文字列の垂直方向の位置(縦位置)を設定・取得します。
<取得>
result = Object.VerticalAlignment
<設定>
Object.VerticalAlignment = const
引数・戻り値
- object ・・・ 対象となる Range オブジェクトを指定します。
- const ・・・ 垂直(縦)方向の配置位置を指定する値・定数を指定します。
- result ・・・ 垂直(縦)方向の配置位置を表す値
引数 const に指定する垂直方向配置位置を表す定数
| 定数 | 値 | 内容 |
| xlTop | -4160 | 上詰め |
| xlJustify | -4130 | 両端揃え |
| xlDistributed | -4117 | 均等割り付け |
| xlCenter | -4108 | 中央揃え(既定値) |
| xlBottom | -4107 | 下詰め |
VerticalAlignment プロパティ 使用例
サンプルVBAソース
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Sub Sample_VerticalAlignment() Range("A1:C1").VerticalAlignment = xlTop Range("A2").VerticalAlignment = xlBottom Range("B2:C2").VerticalAlignment = xlCenter End Sub |
実行結果
サンプルVBAソース実行前
実行後
関連記事
-
-
セルの高さ・幅を取得(Height プロパティ・Width プロパティ)
Height プロパティ・Width プロパティ Height プロパティは、指 …
-
-
フリガナ(Phonetics プロパティ)
Phonetics プロパティ Phonetics コレクションを返します。値の …
-
-
オートフィルタ(抽出条件で使用できる演算子・記号)AutoFilter メソッド
AutoFilter メソッド 【書式】 object.AutoFilter ( …
-
-
オートフィルタ(矢印を非表示にする)AutoFilter メソッド
AutoFilter メソッド 【書式】 object.AutoFilter ( …
-
-
セルをアクティブにする・セルを選択する(Activate, Select)
セルをアクティブにする・選択する 【書式:セルをアクティブにする】 object …
-
-
行の高さを取得・設定・する(RowHeight プロパティ)
RowHeight プロパティ RowHeight プロパティは、対象セルの高さ …
-
-
セル幅・高さの既定値(StandardHeight プロパティ・StandardWidth プロパティ)
StandardHeight プロパティ・StandardWidth プロパティ …
-
-
AutoFilter オブジェクト(メソッド・プロパティ)
AutoFilter.ShowAllData メソッド AutoFilter.S …
-
-
文字の向きを表す値を取得・設定する(Orientation プロパティ)
Orientation プロパティ Orientation プロパティで、文字列 …
-
-
オートフィルタの設定と解除(AutoFilter メソッド)
AutoFilter メソッド オートフィルタを設定する場合、AutoFilte …

