Macro Comments in Excel VBA
A macro comment is a piece of text in a macro which will not be executed by Excel VBA. It is only there to provide you information about the macro.
To add a comment, execute the following steps.
1. Open the Visual Basic Editor.
2. To let Excel VBA know that you want to insert a comment, precede the text with an apostrophe.
Note: Excel VBA colors the line green to indicate that it's a comment. Comments become more useful as program size increases.
You can also convert multiple code lines to comments temporarily. Sometimes this is easier than deleting and rewriting them.
3. First, display the Edit toolbar. Click View, Toolbars, Edit.
4. Select the code lines.
5. Click the Comment Block button.
Note: To remove the apostrophes, select the code lines and click the Uncomment Block button next to the Comment Block button.
If you're new here, welcome to Excel Easy! Join over 1 million monthly Excel learners. You can find popular courses here: Data Analysis in Excel and Excel VBA.