VBA Comment Block and Uncomment Block
In VBA, coding comments are showing in green color.
Comment block is used when you have written the full code in the Editor Pane then, if you want to check the part of the code by running it, you can convert the part of the code to Comment.
This whole process is known as Comment Block and the reverse process of this (To convert the Comment to Uncomment) is known as the Uncomment block.
To convert the code to the comment, first of all, we have to add the Comment block and Uncomment block button to the View tab.
Go to the View tab
Click on the Toolbar button, then go to the Customize…
Click on Commands
In the categories, go to Edit
Scroll down Commands and you can see Comment Block and Uncomment Block, double click on that, drag and drop it to the Edit tab, like this…
Till now, you understand how to add Comment Block and Uncomment Block to the View tab…
Now, let’s understand the process of how to work with these.
First of all, select the code which you want to convert to the comment.
Go to the Edit tab and then click on Comment Block.
After running the remaining code, if you want to convert the comment into code, select the comment which you converted from code and go to the Edit tab again and click on Uncomment Block.
Related: Excel VBA common basic questions
Related: How to Record, Run and Save Macro
Related: How to add VBA to the Excel