VBA Comment Structure

This section of the VBA learning course reviews the Comment Structure. In every programming language, you need to have the ability to write comments within your code. Adding comments is a useful way to remember logic, versions, or even ideas.

In VBA, comments can be added using two methods:

  • Single Quote (‘)
  • REM Keyword

Single Quote (‘) Comment Method

By adding a single quote (‘) at the start of a line, the entire statement is treated as a comment.

Single Quote Comment in VBA
Single Quote comment in VBA

REM Keyword Method

Any line that starts with REM will be treated as a comment.

REM Keyword Method
REM Keyword Method for comments

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Send this to a friend