Range("A1").HorizontalAlignment = xlHAlignLeft
Range("B1").HorizontalAlignment = xlHAlignCenter
Range("C1").HorizontalAlignment = xlHAlignRight
Range("A2").VerticalAlignment = xlVAlignTop
Range("B2").VerticalAlignment = xlVAlignCenter
Range("C2").VerticalAlignment = xlVAlignBottom
実行結果
Range("B1").HorizontalAlignment = xlHAlignCenter
定数 | 内容 |
---|---|
xlHAlignGeneral | 標準 |
xlHAlignLeft | 左詰め |
xlHAlignCenter | 中央 |
xlHAlignRight | 右詰め |
xlHAlignCenterAcrossSelection | 選択範囲内で中央 |
xlHAlignDistributed | 均等割り付け |
xlHAlignFill | 繰り返し |
xlHAlignJustify | 両端揃え |
Range("B2").VerticalAlignment = xlVAlignCenter
定数 | 内容 | 値 |
---|---|---|
xlVAlignTop | 上詰め | -4160 |
xlVAlignCenter | 中央 | -4108 |
xlVAlignBottom | 下詰め | -4107 |
xlVAlignJustify | 両端揃え | -4130 |
xlVAlignDistributed | 均等割り付け | -4117 |
Range("A1:A9").Value = "あいう"
Range("A1").Orientation = xlDownward
Range("A2").Orientation = xlHorizontal
Range("A3").Orientation = xlUpward
Range("A4").Orientation = xlVertical
Range("A5").Orientation = -90
Range("A6").Orientation = -45
Range("A7").Orientation = 0
Range("A8").Orientation = 45
Range("A9").Orientation = 90
定数 | 内容 |
---|---|
xlDownward | 下向き |
xlHorizontal(既定値) | 水平 |
xlUpward | 上向き |
xlVertical | 垂直 |
実行結果