Results 1 to 6 of 6

Awesome Vba Add-in

This is a discussion on Awesome Vba Add-in within the General Excel Discussion & Other Questions forums, part of the Question Forums category; 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 ...

  1. #1
    Board Regular
    Join Date
    Mar 2007
    Location
    Sanford, Maine, USA
    Posts
    321

    Default Awesome Vba Add-in

    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!
    "Next time, make sure you click SAVE before you accidentally run that infinite loop..."

    Gary Ritter Jr.
    Office Ultimate 2007 & Student Teacher 2003

    My Other Favorite Excel Site: http://www.puremis.net/excel/index.shtml

  2. #2
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling
    Posts
    65,967

    Default Re: Awesome Vba Add-in

    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?
    If posting code please use code tags.

  3. #3
    Board Regular
    Join Date
    Mar 2007
    Location
    Sanford, Maine, USA
    Posts
    321

    Default Re: Awesome Vba Add-in

    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 by GaryR; Apr 9th, 2008 at 01:39 PM.
    "Next time, make sure you click SAVE before you accidentally run that infinite loop..."

    Gary Ritter Jr.
    Office Ultimate 2007 & Student Teacher 2003

    My Other Favorite Excel Site: http://www.puremis.net/excel/index.shtml

  4. #4
    Board Regular
    Join Date
    Mar 2007
    Location
    Sanford, Maine, USA
    Posts
    321

    Default Re: Awesome Vba Add-in

    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
    "Next time, make sure you click SAVE before you accidentally run that infinite loop..."

    Gary Ritter Jr.
    Office Ultimate 2007 & Student Teacher 2003

    My Other Favorite Excel Site: http://www.puremis.net/excel/index.shtml

  5. #5
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    27,112

    Default Re: Awesome Vba Add-in

    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...
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  6. #6
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling
    Posts
    65,967

    Default Re: Awesome Vba Add-in

    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.
    If posting code please use code tags.

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com