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. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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, 8 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
-
Sometimes I wonder about these bots
by
Susan Bradley
4 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
6 hours, 9 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
7 hours, 9 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
6 hours, 34 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
3 hours, 4 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
9 hours, 51 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
9 hours, 52 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
3 hours, 45 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
18 hours ago -
0Patch, where to begin
by
cassel23
12 hours, 2 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 7 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
19 hours, 23 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
1 day, 16 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 7 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
18 hours, 17 minutes ago -
Installer program can’t read my registry
by
Peobody
57 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
1 day, 4 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 12 hours ago -
False error message from eMClient
by
WSSebastian42
2 days, 3 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 12 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
2 days, 13 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
13 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
2 days, 17 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
32 minutes ago -
Outdated Laptop
by
jdamkeene
2 days, 22 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
3 days, 3 hours ago -
Another big Microsoft layoff
by
Charlie
3 days, 3 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
5 hours, 46 minutes ago -
May 2025 updates are out
by
Susan Bradley
7 hours, 28 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
3 days, 9 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.