大家好,要怎么在Excel中设置单元格中的对齐方式,如居中,靠左靠下等。

解决方案 »

  1.   

    Columns("D:D").HorizontalAlignment = xlCenter 'xlLeft or xlRight
    Columns("D:D").VerticalAlignment = xlBottom 'xlCenter or xlTop
      

  2.   

    Columns("D:D").WrapText = True
      

  3.   


    左右居中、左、右
    Columns("D:D").HorizontalAlignment = xlCenter 'xlLeft or xlRight底、中、顶
    Columns("D:D").VerticalAlignment = xlBottom 'xlCenter or xlTop