Does any one know of any addin that enables you to add/remove line numbers in your code from within the VBA editor? I find this feature invaluable in locating the line number where an error occurs after code is sent out. There’s a great VB6 addin called CodeSmart which does this kind of thing, but is doesn’t work in VBA.
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
VBA Editor Tool to Add/Remove Line Numbers? (VBA)
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » VBA Editor Tool to Add/Remove Line Numbers? (VBA)
- This topic has 9 replies, 5 voices, and was last updated 23 years, 7 months ago.
AuthorTopicWSdchernin
AskWoody LoungerSeptember 6, 2001 at 3:41 pm #360005Viewing 1 reply threadAuthorReplies-
WSKevin
AskWoody LoungerSeptember 6, 2001 at 10:57 pm #541118I take it you manually enter the line numbers then use the hidden, undocumented erl() function in your error routine to tell you the line number, correct?
I’ve been working on a sub specific routine that will display the list of subs/functions in a module and allow you to apply line numbers to selected subs. It could be modified to just apply the line numbers to an entire project, but I’m not ready for that…
…because I have no code *yet* to remove the line numbers. Ha!
-
WSdchernin
AskWoody LoungerSeptember 7, 2001 at 1:46 am #541148Kevin–
Thanks for the response. Yes, I use the erl in my error routine; it’s helped me track down a lot of problems from afar. As for inserting/removing the line numbers, sometimes I do it manually, and sometimes, when I’ve got a spare moment, I just copy the whole module into a VB project and let CodeSmart do its thing. I started writing an addin to do this stuff too, but kept on getting pulled away from it by more pressing matters (like my boss wanting additional features, etc.)Dan
-
-
WSjujuraf
AskWoody LoungerSeptember 7, 2001 at 11:14 pm #541323I found a VBA add-in that adds line numbers to your code.I haven’t used it yet and forgot about it until I saw your post. I just now installed it but haven’t run it yet. I don’t remember where I got it but I was thrilled to see any add-in for VBA as there are so few. Here is part of the readme file:
– Line Numbering Utilities is a true Microsoft Office COM add-in
developed in Visual Basic for Applications 6.0. (VBA) and designed for
the Visual Basic Editor (VBE).– Line Numbering Utilities is designed to help VBA developers to
easily add/remove line numbers to their Microsoft Office VBA projects.
(Microsoft Office 2000 and XP)– The VBE environment is unchanged from its default settings, aside from
the Line Numbering Utilities menu item added under the Add-ins menu.Deb
-
WSgwhitfield
AskWoody Lounger -
WSjujuraf
AskWoody LoungerSeptember 7, 2001 at 11:09 pm #541374Geoff W. Added hyperlinks
Up until now I never bothered to install the thing so I had to do that first before I could answer this question. I already sent the .zip file to the original poster and he’s going to report back on how well it works. I didn’t have a need for it at the time but there are so very few VBA add-ins that I just downloaded to see what it’s like. I found the URL in the about box:
http://www.siam-consulting.com/Downloads.htm
They offer two cool tools: 1) Commandbar Controls ID Browser, and 2) Line Numbering Utilities.
I installed and ran the Line Numbering tool and it seemed to work just fine.
Enjoy, Deb
-
WSdchernin
AskWoody Lounger -
WSjujuraf
AskWoody LoungerSeptember 21, 2001 at 2:31 pm #543549OOOOOHHHHHhh, you didn’ say you want to “remove” the line numbers as well
I only tried it in Excel but I didn’t save the workbook with the numbers so don’t know if the numbers couldn’t be removed. I’d write the people who created it as from the one e-mail I got from them the seemed very helpful. I’m sure they intended to write a program that let you remove the numbers as well.
I’m glad it worked for you (sort of).
Deb
-
WScharlotte
AskWoody LoungerSeptember 21, 2001 at 11:09 pm #543636VBACodePrint is a VBA add-in that allows you to print your code with or without line numbers. You don’t have to add them anywhere, the add-in does it when it formats the code for printing. You can find it at http://www.jn-software.com/. There are actually versions for VB, VBA, SQL Server, etc., and none of them is very expensive. If have it for both VB and VBA, and it works very well.
-
WSjujuraf
AskWoody LoungerSeptember 22, 2001 at 5:43 am #543660Actually I think the originator wanted line numbers for debug purposes not for printing per se. It was to be used when an error is triggered so he knows exactly what line caused it. The tool I told him about is a VBA control that worked just fine to add the numbers but he said he couldn’t see how to remove them later. I only tried to add the numbers in Excel, whereas he’s using Word.
But, VBACodePrint is a nice utility to have as well..
Deb
-
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
5 hours, 57 minutes ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
1 hour, 59 minutes ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
8 hours, 23 minutes ago -
Return of the brain dead FF sidebar
by
EricB
1 hour, 16 minutes ago -
windows settings managed by your organization
by
WSDavidO61
3 hours, 5 minutes ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
3 hours, 18 minutes ago -
The local account tax
by
Susan Bradley
33 minutes ago -
Recall is back with KB5055627(OS Build 26100.3915) Preview
by
Alex5723
15 hours ago -
Digital TV Antenna Recommendation
by
Win7and10
7 hours, 32 minutes ago -
Server 2019 Domain Controllers broken by updates
by
MP Support
1 day, 2 hours ago -
Google won’t remove 3rd party cookies in Chrome as promised
by
Alex5723
1 day, 4 hours ago -
Microsoft Manager Says macOS Is Better Than Windows 11
by
Alex5723
1 day, 7 hours ago -
Outlook (NEW) Getting really Pushy
by
RetiredGeek
10 hours, 9 minutes ago -
Steps to take before updating to 24H2
by
Susan Bradley
58 minutes ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
14 hours, 35 minutes ago -
Replacing Skype
by
Peter Deegan
3 hours, 8 minutes ago -
FileOptimizer — Over 90 tools working together to squish your files
by
Deanna McElveen
1 day, 1 hour ago -
Excel Macro — ask for filename to be saved
by
nhsj
51 minutes ago -
Trying to backup Win 10 computer to iCloud
by
SheltieMom
2 hours, 55 minutes ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
3 days, 7 hours ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
3 days, 9 hours ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
3 days, 9 hours ago -
No April cumulative update for Win 11 23H2?
by
Peobody
1 day, 21 hours ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
3 days, 10 hours ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
4 days, 1 hour ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
4 days, 4 hours ago -
Inetpub can be tricked
by
Susan Bradley
2 days, 12 hours ago -
How merge Outlook 2016 .pst file w/into newly created Outlook 2024 install .pst?
by
Tex265
2 days, 22 hours ago -
FBI 2024 Internet Crime Report
by
Alex5723
4 days, 8 hours ago -
Perplexity CEO says its browser will track everything users do online
by
Alex5723
1 day, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.