Being able to comment a block of code is a standard operation in any IDE, but for some reason the Microsoft Office VBA Editor does not include that functionality by default. However, the functionality is there and waiting to be used, it’s just hidden in the “Edit” toolbar which is not visible be default.
How to add the comment & uncomment buttons to the Office VBA Editor
- Open the VBA Editor (Alt + F11).
- Right click anywhere on the toolbar.
- Select the “Edit” Toolbar.
- You will now be able to quickly and easily comment a block of code (or uncomment) using these new buttons on your toolbar:
- Done!
Here is a short video showing how to enable the edit toolbar to get access to the comment and uncomment buttons:
Hope this helps!
Alin Dr?ghici says
Thanks!
Jules says
Awesome! Thanks!
Erik says
Wow! Wish I’d known this a long time ago! Cool, Thanks!
Sequoia D. Schroeder says
Super helpful! Glad I found this!! Thank you.
John says
Thanks, you explained it well and succinctly