How to Comment & Un-comment a Block in Office VBA Editor

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.

  1. Open the VBA Editor (Alt + F11).
  2. Right click anywhere on the toolbar.
  3. Select the “Edit” Toolbar.
  4. You will now be able to quickly and easily comment a block of code (or uncomment) using these new buttons on your toolbar:
  5. Done!

Hope this helps!

Ref: https://www.tachytelic.net/2018/11/how-to-comment-a-block-of-code-in-the-microsoft-office-vba-editor/