Macro Comments

 

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.

Macro Comment Example

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

Did you find this information helpful? Show your appreciation, vote for us.

Go to Top: Macro Comments    |    Go to Next Topic: MsgBox

Learn more about comments, Login to the right >>
100 easy to follow Excel VBA examples. Limited time-offer: $39.00 but only $29.00. Ends on 31 May.