文字の向きを表す値を取得・設定する(Orientation プロパティ)
2015/08/26
Orientation プロパティ
Orientation プロパティで、文字列の向きを表すバリアント型(Variant)の値を取得、または設定します。数値(-90 ~ 90)または方向を表す定数(XIOrientation 列挙型)を使用します。
<取得>
result = Object.Orientation
<設定>
Object.Orientation = long
引数・戻り値
- object ・・・ 対象となる Range オブジェクトを指定します。
- long ・・・ 文字列の向きを表す値を指定します。角度を -90 ~ 90 の間の数値で指定するか、方向を示す XIOrientation 列挙型 の定数を用いることができます。
- result ・・・ 文字列の向きを表す値(角度または、XIOrientation 列挙型の定数値)。
longに指定する値(XIOrientation 列挙型等)
| 定数 | 値 | 角度(内容) |
| xlDownward | -4170 | -90°(下向き) |
| xlHorizontal(既定値) | -4128 | 0°(水平方向) |
| xlUpward | -4171 | 90°(上向き) |
| xlVertical | -4166 | (縦方向でセルの中央に配置) |
Orientation プロパティ 使用例
サンプルVBAソース
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
Sub SampleOrientation() 'xlDownward Range("A1").Orientation = xlDownward 'xlHorizontal Range("A2").Orientation = xlHorizontal 'xlUpward Range("A3").Orientation = xlUpward 'xlVertical Range("A4").Orientation = xlVertical '0度 Range("A5").Orientation = 0 '45度 Range("A6").Orientation = 45 '90度 Range("A7").Orientation = 90 '-45度 Range("A8").Orientation = -45 '-90度 Range("A9").Orientation = -90 End Sub |
実行結果
関連記事
-
-
任意のセルを含む行または列全体を参照(EntireRow プロパティ,EntireColumn プロパティ)
EntireRow プロパティ・EntireColumn プロパティ Entir …
-
-
入力規則(日本語入力)Validation オブジェクト,IMEMode プロパティ
IMEMode プロパティ Validation.IMEMode プロパティ を …
-
-
対象のセルが直接参照しているセル全てを取得(DirectPrecedents プロパティ)
DirectPrecedents プロパティ DirectPrecedents …
-
-
セルをアクティブにする・セルを選択する(Activate, Select)
セルをアクティブにする・選択する 【書式:セルをアクティブにする】 object …
-
-
指定したセルへ移動(Goto メソッド)
指定したセルへ移動 指定したシートの指定したセルへジャンプするには、Goto メ …
-
-
別シートのセルを選択(Goto メソッド / PreviousSelections プロパティ)
Goto メソッド 次の例のように、1 行で、Activate メソッド や S …
-
-
直前のセル・直後のセルを参照する(Previous プロパティ・Next プロパティ)
Previous プロパティ・Next プロパティ Previous プロパティ …
-
-
オートフィルタの状況を確認(AutoFilterMode, FilterMode)
AutoFilterMode プロパティ AutoFilterMode プロパテ …
-
-
A1 形式と R1C1 形式を変換、相対参照と絶対参照を変換(ConvertFormula)
ConvertFormula メソッド 数式で参照しているアドレスの相対参照と絶 …
-
-
書式で検索(Find メソッド,FindFormat プロパティ)
書式で検索 書式を条件にセルを検索する場合、まず、その書式条件を CellFor …
