Awesome Vba Add-in

GaryR

Active Member
Joined
Mar 13, 2007
Messages
321
ok,
it's a really simple little thing but i think this is SOO handy! i love it!

http://www.oaltd.co.uk/Indenter/Default.htm

Smart Indenter v3.5
Run it on your completed code and it goes through and corrects all of your indentations and makes all your multi-line code line up

lots of options to control the way it indents and will do just a procedure, just a module, or an entire project at a time!

love it!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Gary

I've not given the add-in a go, perhaps later.:)

But one thought - shouldn't you be doing the indenting yourself in the first place?
 
Upvote 0
of course you should, but this cleans it all up further just in case. makes it "pretty"

plus it does stuff i don't take the time to do, like line up multiline comments and code lines regardless of operators, such as this
Code:
    MsgBox "This is a message box that uses" & _
           "multiple lines and it will make sure it's all" _
         & "lined up correctly regardless of operators."
 
Last edited:
Upvote 0
And of course it'll indent all your loops to ease debugging. finally realize you forgot one End If!
Code:
    If a = b Then
        c = d
    Else
        If e = f Then
            g = h
        End If
    End If
    For a = 1 To 2
        For b = 3 To 4
            Cells(a, b).Value = "text"
        Next a
    Next b
 
Upvote 0
But one thought - shouldn't you be doing the indenting yourself in the first place?
I always do, but what about all the code you inherit? That is where it can really be useful (apparently, the programmer before me didn't believe in indenting or documenting). Of course, at this point, I have already re-written most of his code anyway...
 
Upvote 0
jm14

Good point.:)

But generally what I do when inheriting code is try and find out it's actual purpose.

Then if needed rewrite.

Obviously I'll refer to the original code but there's nothing wrong with starting over.:)
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,237
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top