Indent Level Property and Insertlndent Method

The IndentLevel property returns or sets the left indent for each cell in the range and can be any integer between 0 and 15. All other settings cause an error. Presumably, indents are useful for aligning the contents of cells or for formatting text.

For instance, to set the indent level of cell A1 to 10, we can write:

Range("A1").IndentLevel = 10

Unfortunately, the documentation does not specify how big an indent unit is, but we can still use indent units in a relative way. Presumably, an indent level of 2 is twice that of an indent level of 1.

An alternative is to use the InsertIndent method, with the syntax:


where InsertAmount is an integer between 0 and 15. However, in this case, the InsertAmount parameter specifies the amount to change the current indent for the range.

Was this article helpful?

+2 -2
Black Jack Tactics Conquering The Game In Casinos

Black Jack Tactics Conquering The Game In Casinos

So, you want to learn how to play Blackjack. Youre in good hands. There is no better ship to chart those learning waters than the one youre riding on right now.

Get My Free Ebook


  • russom
    How to calculate indent level in vba excel?
    2 years ago
  • mezan
    How to indent messages in vba?
    1 year ago
  • Aija
    How to reverse indent excel vba?
    8 months ago
  • jole
    How to use ".leftindent" in excel vba?
    1 month ago

Post a comment