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.
- 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!
Hope this helps!
Ref: https://www.tachytelic.net/2018/11/how-to-comment-a-block-of-code-in-the-microsoft-office-vba-editor/