• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Code editor display of line numbers


Hello There,

I came across below sample VBA code (attached snapshot). At start of each line code, there is a line/seq number.

Can anyone suggest which tool can be used for such display and use of line/sequence numbers?


Thank you & regards,


Excel Ninja
Google gives eg this
You can test it Yourself


Active Member
Those numbers were typed manually. This type of numbering was common in BASIC (many years ago) and VBA allows such numbering to be done manually although it is not required as many other options are available to control the flow of looping or recursive procedures. Labels can be useful for directing program flow using a GOTO statement. VBA also allows the use of text labels for directing program flow. You may have seen these in examples using such constructs as "On Error GoTo ErrorHandler" which would direct the program to resume at the label "ErrorHandler:"

Hope that helps.


Marc L

Excel Ninja
when you see such sample just forget it, move to next one !​
As VBA never needs such numbers on every codeline,​
just a legacy from its grand pa' the BASIC ~ 40 years ago where these numbers were required.​
Maybe the author of your sample was on a very bad trip, some Woodstock revival …​