A while back I figured out how to put a few characters before and after several lines of code in iLogic to make it compress to one line or expand to its full size inside the code editor. I belive this is a fairly common VBA command, but I can't figure out how to do it again. I'm not very familiar with the guts of VBA, anyone know how to do this? I'm a neat freak and I'd really like to compress my code to make it easier to read. Thanks
Solved! Go to Solution.
This also works:
'[ You can add some label text here
So, in case it is hard to tell what I did there, that's a single quote mark (also used to create comments), followed by an open square bracket, followed by a space. You can then add whatever text you like, usually describing the code that is collapsed.
You can control where the collapsing stops by including a single quote mark followed by a closed square bracket.
The Sub Main() ... End Sub works, but you can only have one of those per rule. If you have several code sections that you want to collapse, use the method I described. It's also possible to nest with this method.
''' Three inverted commas (as used for a comment line) will collapse the comments to a small block.
I'm not quite sure why you'd want to, but worth a mention in your quest for tidiness.
And here's another useful trick to add to the bag of OCD tidyness tools.
Use the ''' trick on subsequent lines of comments and the whole lot becomes collapsible:
I really like this one!
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register