#1
|
|||
|
|||
How to get Excel VBA to auto-indent code?
In VBA, I have Tools > Options > Editor > Auto Indent checked, yet it doesn't auto-indent my code. For example in a For loop the lines between For and Next remain unindented. Why? Is there a way to force it to indent the code? If not, is there a good add-in for doing this? Thanks. |
#2
|
||||
|
||||
Ha! It's a cheek I know, and it's been like that for decades. It doesn't work as you think it will:
Auto Indent functions when you press Enter key to start a new line, if the code before you press Enter has indentation, the new line will begin at the position of the previous indentation. If you don’t turn on the Auto Indent function, the next line will start on the left. |
#3
|
|||
|
|||
Thanks for the information. It does seem that a decades-old function might be ready for some improvement!
|
Tags |
auto indent |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Code for Indent if criteria is true | Marcia | Excel Programming | 5 | 02-20-2020 06:28 PM |
Difference between first line Indent and Left Indent | kingston123 | Word | 3 | 09-25-2018 02:47 PM |
Undo auto indent | Karen J. | Word | 3 | 02-07-2018 03:24 PM |
Issue of 2 fixed bullet points indent setting work together (code included) | puff | Word VBA | 5 | 12-17-2017 05:52 PM |
auto-indent | mickeyd | Excel | 1 | 06-14-2013 04:52 PM |