top of page
Search
  • Writer's pictureKalpesh Agrawal

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.

  1. Go to the View tab

  2. Click on the Toolbar button, then go to the Customize…

  3. Click on Commands

  4. In the categories, go to Edit

  5. 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.

  1. First of all, select the code which you want to convert to the comment.

  2. Go to the Edit tab and then click on Comment Block.

  3. 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
 

0 comments

Related Posts

See All
bottom of page