Tuesday, September 25, 2012

Excel VBA - Macro Comments


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 let Excel VBA know that it is a comment, place an apostrophe at the start of the text. Execute the following steps to place a comment.
1. Launch the Visual Basic Editor.
2. Insert the line: 'Place the word Hello into cell A1' before the code line. After the line is inserted, Excel VBA colors the line green to indicate that it is a comment.

Macro Comment Example

It is good practice to use comments. Macro comments become more useful as as program size increases.

No comments:

Post a Comment