VBA Code Line Number Writer

  • Copy and paste your entire vba project that needs line numbers into activesheet cell A1.
    Run writeLineNumbers.
    Copy and paste column A & B back into your original project that needed line numbers. Voila, line numbers and (probably) no syntax errors.

    It won't work if you have more than 3250 or so lines of code unless you dim linenum variables as long instead of int.

    Please post any improvements, suggestions or problems. It could start over at 10 every time it encounters a new subroutine, or ignore end ifs and other lines that won't cause err msg, etc

  • Re: VBA Code Line Number Writer

    Thanks Fencliff. For whatever reason I didn't hit on that site while I googled for a freeware solution, so I just made one myself.

    Oh well.

    Anyway, if you still want to do it the HARD way (or your network policy won't let you install add-ins), here's a prettier version that also fixes Select Case statements.

  • Re: VBA Code Line Number Writer

    MZ-Tools dont work with Office 2010 64 bit as the author uses VBA 6 , and Office 64 bit is VBA 7 , so thanks Jeff ! ,I'll use it rather than downgrade to Office 32 bit again, or install Office 2007 again!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!