文字の配置(横位置) | 定数 |
---|---|
標準 | xlGeneral |
左詰め(インデント) | xlLeft |
中央揃え | xlCenter |
右詰め(インデント) | xlRight |
繰り返し | xlFill |
両端揃え | xlJustify |
選択範囲内で中央 | xlCenterAcrossSelection |
均等割り付け(インデント) | xlDistributed |
Sub Alignment01() Range("B3").HorizontalAlignment = xlGeneral '標準 Range("B4").HorizontalAlignment = xlLeft '左詰め(インデント) Range("B5").HorizontalAlignment = xlCenter '中央揃え Range("B6").HorizontalAlignment = xlRight '右詰め(インデント) Range("B7").HorizontalAlignment = xlFill '繰り返し Range("B8").HorizontalAlignment = xlJustify '両端揃え Range("B9").HorizontalAlignment = xlCenterAcrossSelection '選択範囲内で中央 Range("B10").HorizontalAlignment = xlDistributed '均等割り付け(インデント) End Sub
文字の配置(縦位置) | 定数 |
---|---|
上詰め | xlTop |
中央揃え | xlCenter |
下詰め | xlBottom |
両端揃え | xlJustify |
均等割り付け | xlDistributed |
Sub Alignment02() Range("B3").VerticalAlignment = xlTop '上詰め Range("B4").VerticalAlignment = xlCenter '中央揃え Range("B5").VerticalAlignment = xlBottom '下詰め Range("B6").VerticalAlignment = xlJustify '両端揃え Range("B7").VerticalAlignment = xlDistributed '均等割り付け End Sub