Comments in VBA
In computer programming, a comment is a kind of statement that can be used to make source code more readable and understandable.
Comments in source code having no execution effect.
Comments are ignored by compilers and interpreters.
In VBA there are two methods to use comments
Comments in VBA Video in Hindi
Method 1 : Comments in VBA
Any statement that starts with a Single Quote (‘) is treated as a comment.
Example
In below example, all Green lines are comments which are ignored by the computer
Method 2 : Comments in VBA
Any statement that starts with the keyword “REM”.
Example
In below example, all Green lines are comments because all green lines start with the word “REM” which are ignored by the computer.
Important things about Comments
- Comments are non-executable statements in the program
- Generally, Comments provides supplementary information about coding.
- Any number of comments one can use in a program.