Indent in Multi-Level List

Copper Contributor

Hi!

Can you tell me how to record intend increase and decrease in a multilevel list through Macros?

 

 

Capture.PNG

6 Replies
Hi, There is better than a macro: there are shortcuts. Ctrl+M increases the indentation, Ctrl+Shift+M decreases it. Kind regards Hans
Thank you so much but the thing is, it is required only through Macros. Is there any way of doing this in VBA Macros?

@alphakeverest 

 

You can use the following commands:

 

Selection.Range.ListFormat.ListIndent  'indents/demotes the level in the selection

Selection.Range.ListFormat.ListOutdent  'outdents/promotes the level in the selection

 

 

@Stefan_Blom
Thank you so much. It worked

@alphakeverest 

 

I'm glad I could help.

  

Note that the comments I added (starting with single quotation marks) are not part of the code. They are not supposed to wrap, but I see that they do here (when I tried to format the code samples as code samples, the problem became worse). You can just delete the 'indents/demotes the level in the selection and 'outdents/promotes the level in the selection parts.

@Stefan_Blom
Yes I already knew about how to comment in visual basic so I just copied only the part prior to this single quotation mark.
Once again, thanks a bunch.