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 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.
It is good practice to use comments. Macro comments become more useful as as program size increases.
No comments:
Post a Comment