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
-
Totally disable Bitlocker
by
CWBillow
5 minutes ago -
Totally disable Bitlocker
by
CWBillow
1 hour, 44 minutes ago -
Windows 11 ad from Campaign Manager in Windows 10 (Awaiting moderation)
by
Jim McKenna
5 hours, 13 minutes ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
13 hours, 52 minutes ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
15 hours, 44 minutes ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
18 hours, 53 minutes ago -
Mystical Desktop
by
CWBillow
19 hours, 7 minutes ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
24 minutes ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
9 hours, 18 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
1 day, 10 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
1 day, 13 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
1 day, 11 hours ago -
What is wrong with simple approach?
by
WSSpoke36
1 day, 3 hours ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
1 day, 22 hours ago -
Location, location, location
by
Susan Bradley
13 hours, 5 minutes ago -
Cannot get a task to run a restore point
by
CWBillow
2 days ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
1 day, 14 hours ago -
June 2025 Office non-Security Updates
by
PKCano
2 days, 10 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
13 hours, 25 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
2 days, 10 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
2 days, 21 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
1 day, 23 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
3 days, 5 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
3 days, 5 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
2 days, 19 hours ago -
Firefox 139
by
Charlie
2 days, 12 hours ago -
Who knows what?
by
Will Fastie
1 day, 14 hours ago -
My top ten underappreciated features in Office
by
Peter Deegan
3 days, 6 hours ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
1 day ago -
Misbehaving devices
by
Susan Bradley
2 days, 2 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.