Loading

Wednesday, March 4, 2009

Data Alignment

In Excel VBA macro we can control the alignment of data in a cell, both horizontally and vertically. To change alignment, we can use the following properties of the Range object:
  • HorizontalAlignment. Set to xlLeft, xlCenter, xlRight, xlDistributed, or xlJustify.
  • VerticalAlignment. Set to xlTop, xlCenter, xlBottom, xlDistributed, or xlJustify.
Following example sets horizontal alignment to justify:

Worksheets("Sheet1").Range("A1:D5").HorizontalAlignment = xlJustify

SHARE TWEET

Thank you for reading this article Data Alignment With URL https://x-tutorials.blogspot.com/2009/03/data-alignment.html. Also a time to read the other articles.

0 comments:

Write your comment for this article Data Alignment above!