Version 6.0 of CodeLiner

The newest version of CodeLiner has an option to customize your starting line number!

CodeLiner shows line numbers in your VBA macros.

Why are line numbers so important? Well, did you ever notice that the Erl function always returns 0 in your Office code? That’s because Erl requires line numbers in order to work properly. Once you have line numbers, you can use Erl to automatically show the exact location of your error, making debugging a lot easier.

Go to the Tumbling Wave Software product page for a free trial download, and improve your code with line numbers!

Office Code Readability

This post discusses ways to ease your ability to read someone else’s code.

Did you ever look at someone’s Office macro and think to yourself, “Boy, this is hard to read”? I know I have, and it’s particularly bad when they’re using line numbers. Though line numbers help in identifying errors during debugging, they become more of an irritant when you are trying to read code for some other purpose. We want the ability to debug, but we also want to be able to read – can we have it both ways? – yes, we can!

To make code more readable, we could go through every line and manually delete each line number, but that would be quite a chore. Or, you could print out the code before adding in the line numbers. Alas, with code changing so often, this too seems like an impractical solution.

The best way I’ve found to quickly remove line numbers is to use this handy little tool:

VBA Line Numbers with CodeLiner

It’s pretty cool – once installed, you will see a new toolbar in your VBA Editor, whether it’s Excel, Access or Word. The toolbar has a button that simply hides all line numbers in your project! With all the line numbers hidden, the code has instantly become much more readable. Thankfully, there is another button on that same toolbar that will re-insert the line numbers, when you want to go back to debugging your code.

So, code happy with readable code, everybody!